Hi all!
What's wrong with this?
import pandas as pd
x=pd.to_datetime("20160501")
x+pd.DateOffset(days=1)
Timestamp('2016-05-02 00:00:00', tz=None)
x.__add__(pd.DateOffset(days=1))
NotImplemented
More generally I have a class derived from pandas.datetime and I want to
implement its own __add__
Às 04:08 de 08-06-2016, MRAB escreveu:
> On 2016-06-08 03:09, Paulo da Silva wrote:
>> Hi all!
>>
...
>>
>> More generally I have a class derived from pandas.datetime and I want to
>> implement its own __add__ that at a given point call super __add__.
Hi!
I have an environment created with conda (anaconda3).
There is a package that is unavailable in conda.
Installing it with pip3, with conda env activated, the installation goes
to .local/bin and .local/lib in my home dir (BTW I'm running linux
kubuntu 18.04).
This also has a bad side effect! It
Hi!
Does anybody know why this code does not expand the text widget when I
increase the window size (with mouse)? I want height and width but as
minimum (or may be initial) size.
import tkinter as tk
class App:
def __init__(self,master):
self.tboard=tk.Text(master,height=
Às 08:24 de 06/12/18, Peter Otten escreveu:
> Paulo da Silva wrote:
>
...
>
> You have to set the column/row weight of the /master/:
>
> master.grid_columnconfigure(1, weight=1)
> master.grid_rowconfigure(1, weight=1)
Ok. That works!
>
> Als
Às 21:15 de 06/12/18, Rick Johnson escreveu:
> Paulo da Silva wrote:
>
...
>
> In Tkinter, if you have a "container"[1] that only has a
> single widget stuffed inside, and, you want that single
> widget to expand to fill the extents of its parent
> container, the
Às 07:11 de 07/12/18, Christian Gollwitzer escreveu:
> Am 07.12.18 um 03:00 schrieb Paulo da Silva:
>> Às 21:15 de 06/12/18, Rick Johnson escreveu:
...
> So instead of complaining about lacking support in Tk, the
> Python community should do their homework and provide wrapper
Às 01:17 de 08/12/18, jf...@ms4.hinet.net escreveu:
00
> 0
03
> File "", line 1
> 03
> ^
> SyntaxError: invalid token
>
> Any particular reason?
>
Not sure but I think that after 0 it expects x for hexadecimal, o for
octal, b for binary, ... may be others.
0xa
10
0o10
Hi!
Sorry if this is OT.
I decided to give cython a try and cannot run a very simple program!
1. I am using kubuntu 18.04 and installe cython3 (not cython).
2. My program tp.pyx:
# cython: language_level=3
print("Test",2)
3. setup.py
from distutils.core import setup
from Cython.Build import cy
Às 19:48 de 22/12/18, MRAB escreveu:
> On 2018-12-22 18:26, Paulo da Silva wrote:
...
> Well, I've just tried this on Raspbian with the same files (for Python 3):
>
> python3 -m pip install cython
> python3 setup.py build_ext --inplace
> python3 -c 'import tp'
Às 14:07 de 24/12/18, Stefan Behnel escreveu:
> Paulo da Silva schrieb am 22.12.18 um 19:26:
...
>
> Ubuntu 18.04 ships Cython 0.26, which has a funny bug that you hit above.
> It switches the language-level too late, so that the first token (or word)
> in the file is parsed with
Às 19:54 de 09/12/18, Tim Williams escreveu:
> On Saturday, December 8, 2018 at 10:13:14 PM UTC-5, Monte Milanuk wrote:
>> Did you find any solution(s)?
>
> I usually just lurk and read on this list. I don't reply since there's
> usually more competent people that regularly post helpful answers.
Às 19:39 de 02/01/19, Hartmut Goebel escreveu:
> Am 03.12.18 um 18:39 schrieb Paulo da Silva:
>> This also has a bad side effect! It reinstalls there some depedencies
>> already installed in the conda created environment!
>>
>> Is there a way to avoid this situation
Às 17:39 de 03/12/18, Paulo da Silva escreveu:
Well ... further clarification ...
> Hi!
>
> I have an environment created with conda (anaconda3).
> There is a package that is unavailable in conda.
The package is sklearn (import sklearn). - Look below before comment pls.
> Ins
Hi!
I don't know if this is the right group to ask ... sorry if it isn't.
Is there a way to get the file extensions of a file in linux, the same
way as "filefrag -e " does?
The purpose is to see if two files are the same file, namely those
copied with the --reflink option in btrfs.
A solution f
Às 23:09 de 27/03/19, Cameron Simpson escreveu:
> On 27Mar2019 21:49, Paulo da Silva wrote:
...
> The filefrag manual entry says it works by calling one of 2 ioctls. You
> can do that from Python with the ioctl() function in the standard fcntl
> module. I haven't tried to do this
Às 22:18 de 28/03/19, Cameron Simpson escreveu:
> On 28Mar2019 01:12, Paulo da Silva wrote:
>> Às 23:09 de 27/03/19, Cameron Simpson escreveu:
...
>
> Oh, just tangential to this.
>
> If you were doing this ad hoc, yes calling the filefrag executable is
> very expensiv
Às 01:35 de 06/04/19, Pablo Lucena escreveu:
> Have you looked into eBPF?
I'll take a look at that. Thanks Pablo.
--
https://mail.python.org/mailman/listinfo/python-list
Hi all.
I am looking for improved solutions to these two problems.
They are to be in a program that deals with big data. So, they need to
be fast and save memory.
Problem 1.
I have a list of objects and want to split it in a list of groups.
Each group must have all "equal objects" and have more
Às 19:42 de 21/04/19, Stefan Ram escreveu:
> Paulo da Silva writes:
>> I have a list of objects and want to split it in a list of groups.
>> "equal objects" is based on an id we can get from the object.
>
> main.py
>
> input = [ 'abc', '
Às 20:10 de 21/04/19, MRAB escreveu:
> On 2019-04-21 19:23, Paulo da Silva wrote:
>> Hi all.
>>
...
> Have you compared the speed with an implementation that uses
> defaultdict? Your code always creates an empty list for each item, even
> though it might not be needed.
Às 20:41 de 21/04/19, DL Neil escreveu:
> Olá Paulo,
>
...
>
> Given that we're talking "big data", which Python Data Science tools are
> you employing? eg NumPy.
Sorry. I misused the term "big data". I should have said a big amount of
data. It is all about objects built of text and some number
Às 22:21 de 21/04/19, Paul Rubin escreveu:
> Paulo da Silva writes:
>> splitter={}
>> for f in Objs:
>> splitter.setdefault(f.getId1,[]).append(f)
>> groups=[gs for gs in splitter.values() if len(gs)>1]
>
> It's easiest if you can sort the input l
Hi!
How do I create a pandas dataframe with two (or more) groups of cols.?
Ex.:
G1 G2
C1 C2 C3 C1 C2 C3
Rows of values ...
I then should be able to access for example
df['G2']['C3'][]
Thanks.
--
https://mail.python.org/mailman/listinfo/python-list
Às 04:56 de 14/06/19, Paulo da Silva escreveu:
> Hi!
>
> How do I create a pandas dataframe with two (or more) groups of cols.?
>
> Ex.:
>
> G1 G2
> C1 C2 C3 C1 C2 C3
> Rows of values ...
>
> I then should be able to access for example
> df['G2
Às 18:31 de 14/06/19, Paulo da Silva escreveu:
> Às 04:56 de 14/06/19, Paulo da Silva escreveu:
...
>
> After digging a lot :-) , and for those who may be interested, I found
> one way:
>
> In [21]: d1 = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8,
> 9]]),col
Hi all!
Is there any difference between using the base class name or super to
call __init__ from base class?
class C1:
def __init__(self):
...
class C2(C1):
def __init__(self):
C1.__init__(self) or super().__init__() ??
...
I have
Às 15:30 de 12/07/19, Thomas Jollans escreveu:
> On 12/07/2019 16.12, Paulo da Silva wrote:
>> Hi all!
>>
>> Is there any difference between using the base class name or super to
>> call __init__ from base class?
>
> There is, when multiple inheritance is invol
Às 16:20 de 12/07/19, Rhodri James escreveu:
> On 12/07/2019 15:12, Paulo da Silva wrote:
> ...
> super() also has major advantages if you are stuck with multiple
> inheritance. Raymond Hettinger has an excellent article on this here:
> https://rhettinger.wordpress.com/2
Às 02:11 de 15/07/19, Chris Angelico escreveu:
> On Mon, Jul 15, 2019 at 10:51 AM Paulo da Silva
> wrote:
>>
...
>>
>> Thank you Jollans. I forgot multiple inheritance. I never needed it in
>> python, so far.
>>
>
> Something to consider is that sup
Hi!
Suppose a class C.
I want something like this:
class C:
KA=0
KB=1
KC=1
...
Kn=n
def __init__ ...
...
These constants come from an enum in a .h (header of C file).
They are many and may change from time to time.
Is there a way
Às 02:18 de 23/03/20, Paulo da Silva escreveu:
> Hi!
>
> Suppose a class C.
> I want something like this:
>
> class C:
> KA=0
> KB=1
KC=2
> ...
> Kn=n
>
> def __init__ ...
> ...
>
>
> These
Thank you very much for all your responses!
Now I have too much ideas :-)
I'm saving your answers and I'll see what is more
appropriate/comfortable in my case.
Best regards.
Paulo
--
https://mail.python.org/mailman/listinfo/python-list
Hi!
Why this does not work?!
from tkinter import *
def terminate(root):
root.quit
root=Tk()
#b=Button(root,text="QUIT",command=root.quit)
b=Button(root,text="QUIT",command=lambda: terminate(root))
b.pack()
mainloop()
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
Às 22:18 de 21/11/20, Chris Angelico escreveu:
> On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva
> wrote:
>>
>> Hi!
>>
>> Why this does not work?!
>>
>> from tkinter import *
>>
>> def terminate(root):
>> root.quit
>>
>
>
Às 22:44 de 21/11/20, Chris Angelico escreveu:
> On Sun, Nov 22, 2020 at 9:36 AM Paulo da Silva
> wrote:
>>
>> Às 22:18 de 21/11/20, Chris Angelico escreveu:
>>> On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva
>>> wrote:
>>>>
>>>> H
Hi!
Why this example does not work?
--
from tkinter import *
root=Tk()
root.geometry("400x200")
S=Scrollbar(root)
T=Text(root)
T.grid(row=0,column=0)
S.grid(row=0,column=1)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
txt="""This is a very big text
-
-
-
-
-
-
-
-
-
-
Às 20:20 de 05/12/20, MRAB escreveu:
> On 2020-12-05 18:56, Paulo da Silva wrote:
>> Hi!
>>
>> Why this example does not work?
>>
> There are a few bits of configuration missing:
>
>> --
>> from tkinter import *
>>
Hi!
I am looking at some code, that I found somewhere in the internet, to
compute DCT for each 8x8 block in an gray (2D) image (512x512).
This is the code:
def dct2(a):
return
scipy.fft.dct(scipy.fft.dct(a,axis=0,norm='ortho'),axis=1,norm='ortho')
imsize=im.shape
dct=np.zeros(imsize)
# Do
Às 05:55 de 09/12/20, Paulo da Silva escreveu:
> Hi!
>
> I am looking at some code, that I found somewhere in the internet, to
> compute DCT for each 8x8 block in an gray (2D) image (512x512).
>
> This is the code:
>
> def dct2(a):
> return
> scipy.fft.dct(scip
Hi!
Does anybody know why cmd method isn't called when I change the button
state (clicking on it) in this example?
I know that this seems a weird class use. But why doesn't it work?
Thanks.
class C:
from tkinter import Checkbutton
import tkinter
@staticmethod
def cmd():
p
Às 07:42 de 07/01/21, Christian Gollwitzer escreveu:
> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>
>> Does anybody know why cmd method isn't called when I change the button
>> state (clicking on it) in this example?
>> I know that this seems a weird class
Às 09:20 de 07/01/21, Terry Reedy escreveu:
> On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:
>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>
>>> Does anybody know why cmd method isn't called when I change the button
>>> state (clicking on it) in this
Às 16:02 de 07/01/21, Peter Otten escreveu:
> On 07/01/2021 08:42, Christian Gollwitzer wrote:
>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>
...
>
> I recommend that the OP use a more conventional stye and do the setup
> outside the class or, better, in an instanc
Às 07:29 de 07/01/21, Paulo da Silva escreveu:
> Hi!
>
> Does anybody know why cmd method isn't called when I change the button
> state (clicking on it) in this example?
> I know that this seems a weird class use. But why doesn't it work?
> Thanks.
>
>
Às 20:35 de 07/01/21, Terry Reedy escreveu:
> On 1/7/2021 4:20 AM, Terry Reedy wrote:
>> On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:
>>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>>
>>>> Does anybody know why cmd method isn't called when I chan
Hi!
Is there a way to copy a file the same as Unix command:
cp -a --reflink src dest
without invoking a shell command?
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
Where did you read this? I can't find any documentation about __bytes__ on
google.
Regards,
Daniel
On Sat, Jan 11, 2014 at 7:24 PM, Ethan Furman wrote:
> Python 3 has a new method, __bytes__. The docs say: Called by bytes() to
> compute a byte-string representation of an object. This should r
wrote:
> On 01/11/2014 04:53 PM, Daniel da Silva wrote:
>
>>
>> Where did you read this? I can't find any documentation about __bytes__
>> on google.
>>
>
> http://docs.python.org/3.3/reference/datamodel.html?
> highlight=__bytes__#object.__bytes__
>
On Sat, Jan 11, 2014 at 9:44 PM, Ethan Furman wrote:
> On 01/11/2014 06:19 PM, Daniel da Silva wrote:
>
>>
>> One use case is:
>> Suppose you have existing function that accepts a /bytes/ object. If you
>> subclass /bytes/ and want it to be guaranteed
>>
Hi!
I am using a python3 script to produce a bash script from lots of
filenames got using os.walk.
I have a template string for each bash command in which I replace a
special string with the filename and then write the command to the bash
script file.
Something like this:
shf=open(bashfilename,
Em 12-01-2014 16:23, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>> I am using a python3 script to produce a bash script from lots of
>> filenames got using os.walk.
>>
>> I have a template string for each bash command in which I replace a
>> special str
>
> I think instead of the hard way sketched out above it will be sufficient to
> specify the error handler when opening the destination file
>
> shf = open(bashfilename, 'w', errors="surrogateescape")
This seems to fix everything!
I tried with a small test set and it worked.
>
> but I have no
Em 12-01-2014 20:29, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>>> but I have not tried it myself. Also, some bytes may need to be escaped,
>>> either to be understood by the shell, or to address security concerns:
>>>
>>
>> Since I am puting
Em 13-01-2014 08:58, Peter Otten escreveu:
> Peter Otten wrote:
>
>> Paulo da Silva wrote:
>>
>>> Em 12-01-2014 20:29, Peter Otten escreveu:
>>>> Paulo da Silva wrote:
>>>>
>>>>>> but I have not tried it myself. Also, some byte
Em 13-01-2014 17:29, Peter Otten escreveu:
> Paulo da Silva wrote:
>
>> Em 13-01-2014 08:58, Peter Otten escreveu:
>
> I looked around in the stdlib and found shlex.quote(). It uses ' instead of
> " which simplifies things, and special-cases only ':
&
On Tue, Jan 14, 2014 at 8:27 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> But reading Guido, I think he's saying that wouldn't be a good idea. I
> don't get it -- it's not a violation of the Liskov Substitution
> Principle, because it's more restrictive, not less. What am
Try this:
from subprocess import check_output
import sys
check_output("textutil -convert html %s -stdout | pandoc -f html -t
markdown -o %s" % sys.argv[1:3], shell=True)
On Sat, Feb 1, 2014 at 7:19 AM, Rick Dooling wrote:
> I spent half a day trying to convert this bash script (on Mac)
>
> t
Às 22:44 de 04-12-2015, Anna Szaharcsuk escreveu:
> Hello there,
>
> I was trying to install PyCharm, but didn't worked and needed interpreter.
> the computer advised to install the python for windows.
>
I don't know PyCharm but it is likely it needs python.
Did you install python?
You may need
I am not a windows user but googling for
api-ms-win-crt-runtime-l1-1-0.dll I could find many pages on this subject.
The 1st one was
https://www.smartftp.com/support/kb/the-program-cant-start-because-api-ms-win-crt-runtime-l1-1-0dll-is-missing-f2702.html
Search by yourself or use this one, for exa
Às 03:20 de 07-01-2016, Henrique Correa escreveu:
> Is Python's Tutorial (by Guido) a good and complete reference for the
> language?
Good yes. Complete no.
I mean, after reading it, should I have a good basis on Python?
Yes if you know how to program on another language.
>
HTH
Paulo
--
https
Hi all!
I am about to install tensorflow and I am considering to use virtualenv.
Unfortunately I don't know anything about this.
So, a couple of questions before I dig more ...
1. Are all already installed python stuff visible inside virtualenv?
2. I used to use eclipse for development. Is it usab
Às 05:10 de 15-01-2016, Cameron Simpson escreveu:
> On 15Jan2016 03:37, Paulo da Silva wrote:
...
> Virtualenv is so easy to use that i suggest you
> just try it and see.
>
Thank you very much Cameron. Being easy, I'll give it a try with a small
test program and see how
Hi all.
What is the fastest implementation of the following code?
def g(p):
...
return something
def f1(p="p1"):
return g(p)
def f2(p="p2"):
return g(p)
Thanks
Paulo
--
https://mail.python.org/mailman/listinfo/python-list
Às 07:30 de 21-01-2016, Paulo da Silva escreveu:
> Hi all.
>
> What is the fastest implementation of the following code?
>
> def g(p):
> ...
> return something
>
> def f1(p="p1"):
> return g(p)
>
> def f2(p="p2"):
>
Hi!
I am learning pandas and following the tutorial I tried the following:
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000',
periods=1000))
ts = ts.cumsum()
ts.plot()
No plot is produced!
Only the following output:
Any clue on what is happening?
I'm using kubuntu and python
Às 01:43 de 01-02-2016, Mark Lawrence escreveu:
> On 01/02/2016 00:46, Paulo da Silva wrote:
...
>>
>
> Is it as simple as adding a call to ts.show() ?
>
Thanks for the clue!
Not so simple however.
Needed to do
import matplotlib.pyplot as plt
plt.show()
Thank you :-
Às 01:15 de 01-02-2016, Chris Angelico escreveu:
> On Mon, Feb 1, 2016 at 11:46 AM, Paulo da Silva
> wrote:
...
>
> Hmm. Normally I would expect matplotlib to pop up a graph there. Are
> you running this from a terminal, or from some sort of GUI? It might
> make a difference t
Às 14:18 de 01-02-2016, Jason Swails escreveu:
> On Sun, Jan 31, 2016 at 9:08 PM, Paulo da Silva <
> p_s_d_a_s_i_l_v_a...@netcabo.pt> wrote:
>
>> Às 01:43 de 01-02-2016, Mark Lawrence escreveu:
>>> On 01/02/2016 00:46, Paulo da Silva wrote:
...
>
> W
Hello!
This may not be a strict python question, but ...
Suppose I have already a class MyFile that has an efficient method (or
operator) to compare two MyFile s for equality.
What is the most efficient way to obtain all sets of equal files (of
course each set must have more than one file - all
Às 22:17 de 07-02-2016, Tim Chase escreveu:
> On 2016-02-07 21:46, Paulo da Silva wrote:
...
>
> If you the MyFile objects can be unique but compare for equality
> (e.g. two files on the file-system that have the same SHA1 hash, but
> you want to know the file-names), you'd
Às 21:46 de 07-02-2016, Paulo da Silva escreveu:
> Hello!
>
> This may not be a strict python question, but ...
>
> Suppose I have already a class MyFile that has an efficient method (or
> operator) to compare two MyFile s for equality.
>
> What is the most efficient w
Hi!
What is the best (shortest memory usage) way to store lots of pathnames
in memory where:
1. Path names are pathname=(dirname,filename)
2. There many different dirnames but much less than pathnames
3. dirnames have in general many chars
The idea is to share the common dirnames.
More realisti
Às 03:49 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
>> Apart from all of the other answers that have been given:
>>
...
>
> Simpler to let the language do that for you:
>
import sys
p1 = sys.intern('foo/bar')
p2 = sys.intern('foo/bar')
>
Às 04:23 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 3:15 PM, Paulo da Silva
> wrote:
>> Às 03:49 de 12-02-2016, Chris Angelico escreveu:
>>> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
>>>> Apart from all of the o
Às 05:02 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 3:45 PM, Paulo da Silva
> wrote:
...
>> I think a dict, as MRAB suggested, is needed.
>> At the end of the store process I may delete the dict.
>
> I'm not 100% sure of what's going o
Hello all.
I'm running in a very strange (for me at least) problem.
def getHash(self):
bfsz=File.blksz
h=hashlib.sha256()
hu=h.update
with open(self.getPath(),'rb') as f:
f.seek(File.hdrsz) # Skip
I meant eating! :-)
--
https://mail.python.org/mailman/listinfo/python-list
Às 22:45 de 13-02-2016, Chris Angelico escreveu:
> On Sun, Feb 14, 2016 at 9:26 AM, Paulo da Silva
> wrote:
>> I meant eating! :-)
>
> Heh, "heating" works too - the more you use memory, the more it heats up :)
:-) It is heating my head!
...
>
> What happen
I was unable to reproduce the situation using a simple program just
walking through all files>4K, with or without the seek, and computing
their shasums.
Only some fluctuations of about 500MB in memory consumption.
I'll look at this when I get more time, taking in consideration the
suggestions here
Às 07:04 de 14-02-2016, Paulo da Silva escreveu:
> I was unable to reproduce the situation using a simple program just
> walking through all files>4K, with or without the seek, and computing
> their shasums.
> Only some fluctuations of about 500MB in memory consumption.
Today I g
Às 09:49 de 14-02-2016, INADA Naoki escreveu:
> tracemalloc module may help you to investigate leaks.
> 2016/02/14 午後4:05 "Paulo da Silva" :
>
Thanks. I didn't know it!
Paulo
--
https://mail.python.org/mailman/listinfo/python-list
Às 02:21 de 14-02-2016, Steven D'Aprano escreveu:
> On Sun, 14 Feb 2016 06:29 am, Paulo da Silva wrote:
...
Thanks Steven for your advices.
This is a small script to solve a specific problem.
It will be used in future to solve other similar problems probably with
small changes.
When I
Às 08:12 de 15-02-2016, Johannes Bauer escreveu:
> On 15.02.2016 03:21, Paulo da Silva wrote:
>
>> So far I tried the program twice and it ran perfectly.
>
> I think you measured your RAM consumption wrong.
>
> Linux uses all free RAM as HDD cache. That's what is
Kevin, that client library looks like it is for accessing Google Maps
related services, not modifying maps themselves.
On Fri, Dec 19, 2014 at 1:02 AM, Kev Dwyer wrote:
> Veek M wrote:
>
> > I'm messing with Google-Maps. Is there a way I can create a map, embed it
> > on a page (CSS/HTML/Javas
Hi!
What is the best way to read a file that begins with some few text lines
and whose rest is a binary stream?
As an exmaple ... files .pnm.
Thanks for any comments/help on this.
--
https://mail.python.org/mailman/listinfo/python-list
On 10-03-2015 00:55, Dave Angel wrote:
> On 03/09/2015 08:45 PM, Paulo da Silva wrote:
>> Hi!
>>
>> What is the best way to read a file that begins with some few text lines
>> and whose rest is a binary stream?
>>
...
>
> In which version of Python? there&
On 10-03-2015 00:56, Chris Angelico wrote:
> On Tue, Mar 10, 2015 at 11:45 AM, Paulo da Silva
> wrote:
>> Hi!
>>
...
> Read the entire file in binary mode, and figure out which parts are
> text and how they're encoded (possibly ASCII or UTF-8). Then take just
>
On 10-03-2015 04:14, Cameron Simpson wrote:
> On 10Mar2015 04:01, Paulo da Silva wrote:
>> On 10-03-2015 00:55, Dave Angel wrote:
...
>> For .pnm photo files I read the entire file (I needed it in memory
>> anyway), splited a copy separated by b'\n', got the hea
On 10-03-2015 12:41, random...@fastmail.us wrote:
> On Tue, Mar 10, 2015, at 00:01, Paulo da Silva wrote:
>> For .pnm photo files I read the entire file (I needed it in memory
>> anyway), splited a copy separated by b'\n', got the headers stuff and
>> then used the
On 10-03-2015 05:56, Steven D'Aprano wrote:
...
Thank you very much for your post.
I learned what I'm needing from it!
Exactly what I was looking for.
Thank you.
--
https://mail.python.org/mailman/listinfo/python-list
On 11-03-2015 01:09, Cameron Simpson wrote:
> On 10Mar2015 22:38, Paulo da Silva wrote:
>> On 10-03-2015 04:14, Cameron Simpson wrote:
...
>
> Since binary files (returning bytes from reads) also have a convenient
> readline method looking for byte 10 ('\n')
I am new to numpy ...
Supposing I have 2 vectors v1 and v2 and a value (constant) k.
I want to build a vector r with all values of v1 greater than k and the
others from v2.
I found 2 ways, but not sure if they are the best solution:
1.
r1=v1.copy()
r2=v2.copy()
r1[r1=k]=0
r=r1+r2
2.
r=v1*(v1>=k
On 14-04-2015 23:49, Rob Gaddi wrote:
> On Tue, 14 Apr 2015 23:41:56 +0100, Paulo da Silva wrote:
>
>> Supposing I have 2 vectors v1 and v2 and a value (constant) k.
>> I want to build a vector r with all values of v1 greater than k and the
>> others from v2.
&g
I have program that generates about 100 relatively complex graphics and
writes then to a pdf book.
It takes a while!
Is there any possibility of using multiprocessing to build the graphics
and then use several calls to savefig(), i.e. some kind of graphic's
objects?
Thanks for any help/comments.
-
On 21-04-2015 11:26, Dave Angel wrote:
> On 04/20/2015 10:14 PM, Paulo da Silva wrote:
>> I have program that generates about 100 relatively complex graphics and
>> writes then to a pdf book.
>> It takes a while!
>> Is there any possibility of using multiprocessing t
On 21-04-2015 16:58, Chris Angelico wrote:
> On Wed, Apr 22, 2015 at 1:53 AM, Paulo da Silva
> wrote:
>> Yes, I have 8 cores and the graphics' processes calculation are all
>> independent. The problem I have is that if there is any way to generate
>> independent fig
On 21-04-2015 03:14, Paulo da Silva wrote:
> I have program that generates about 100 relatively complex graphics and
> writes then to a pdf book.
> It takes a while!
> Is there any possibility of using multiprocessing to build the graphics
> and then use several calls to savefig(),
Is there anybody using pypy3 in *ubuntu 14.04?
I installed ppa:pypy/ppa but I still cannot see any pypy3!
All refs to pypy (using aptitude) show in the comments python 2.7!
Thanks for any help.
--
https://mail.python.org/mailman/listinfo/python-list
On 26-04-2015 05:09, Paulo da Silva wrote:
> Is there anybody using pypy3 in *ubuntu 14.04?
>
> I installed ppa:pypy/ppa but I still cannot see any pypy3!
> All refs to pypy (using aptitude) show in the comments python 2.7!
>
> Thanks for any help.
>
For those who may be i
101 - 200 of 318 matches
Mail list logo