Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
Found a typo-or-two in my description. #2 and #3 are nnx1 in shape -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Janikas Sent: Tuesday, February 13, 2007 4:31 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] fromstring, tostrin

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
This is all very good info. Especially, the byteswap. Ill be testing it momentarily. As far as a detailed explanation of the problem In essence, I am applying sparse matrix multiplication. The matrix of which I am dealing with in the matter described is nxn. Generally, this matrix is 1-20

Re: [Numpy-discussion] Docstring formatting

2007-02-13 Thread Fred Clare
Sorry for a private e-mail escaping to this list. Fred Clare On Feb 13, 2007, at 4:30 PM, Robert Kern wrote: > Colin J. Williams wrote: > >> Could you give the URL please? > > http://svn.scipy.org/svn/numpy/trunk/numpy/doc/HOWTO_DOCUMENT.txt > > -- > Robert Kern > > "I have come to believe tha

Re: [Numpy-discussion] Docstring formatting

2007-02-13 Thread Fred Clare
Mary, Do you think we should adopt the "official" SciPy docstring format? It is pretty simple. Did you see Konrad Hinson's comment on NetCDF modules? Fred On Feb 13, 2007, at 4:30 PM, Robert Kern wrote: > Colin J. Williams wrote: > >> Could you give the URL please? > > http://svn.scipy.org/sv

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Stefan van der Walt
On Tue, Feb 13, 2007 at 04:02:10PM -0800, Mark Janikas wrote: > Yes, but does the code have the same license as NumPy? As I work > for a software company, where I help with the scripting interface, I > must make sure everything I use is cited and has the appropriate > license. Yes, Scipy and Nu

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Christopher Barker
Mark Janikas wrote: > I don't think I can do that because I have heterogeneous rows of > data I.e. the columns in each row are different in length. like I said, show us your whole problem... But you don't have to write.read all the data at once with from/tofile() anyway. Each of your "rows"

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Robert Kern
Mark Janikas wrote: > Yes, but does the code have the same license as NumPy? As I work for a > software company, where I help with the scripting interface, I must make sure > everything I use is cited and has the appropriate license. The numpy and scipy licenses are the same except for the de

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
Yes, but does the code have the same license as NumPy? As I work for a software company, where I help with the scripting interface, I must make sure everything I use is cited and has the appropriate license. MJ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Stefan van der Walt
On Tue, Feb 13, 2007 at 03:44:37PM -0800, Mark Janikas wrote: > I don't think I can do that because I have heterogeneous rows of > data I.e. the columns in each row are different in length. > Furthermore, when reading it back in, I want to read only bytes of the > info at a time so I can save m

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
I don't think I can do that because I have heterogeneous rows of data I.e. the columns in each row are different in length. Furthermore, when reading it back in, I want to read only bytes of the info at a time so I can save memory. In this case, I only want to have one record in mem at once.

Re: [Numpy-discussion] Docstring formatting

2007-02-13 Thread Robert Kern
Colin J. Williams wrote: > Could you give the URL please? http://svn.scipy.org/svn/numpy/trunk/numpy/doc/HOWTO_DOCUMENT.txt -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Re: [Numpy-discussion] Docstring formatting

2007-02-13 Thread Colin J. Williams
Stefan van der Walt wrote: > Hi Pierre > > On Tue, Feb 13, 2007 at 04:10:09PM -0500, Pierre GM wrote: >> Dear All, >> Did we come to some kind of agreement about the formatting of docstring ? In >> any case, where could I find the 'official' format that Travis recommended ? > > Travis checked nu

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Christopher Barker
Mark Janikas wrote: I am finding that directly packing numpy arrays into binary using the tostring and fromstring methods For starters, use fromfile and tofile, to save the overhead of creating an entire extra string. fromfile is a function (as it is an alternate constructor for arrays): nu

Re: [Numpy-discussion] Docstring formatting

2007-02-13 Thread Stefan van der Walt
Hi Pierre On Tue, Feb 13, 2007 at 04:10:09PM -0500, Pierre GM wrote: > Dear All, > Did we come to some kind of agreement about the formatting of docstring ? In > any case, where could I find the 'official' format that Travis recommended ? Travis checked numpy/doc/HOWTO_DOCUMENT.txt a couple of d

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
Yup. It was faster to: Use lists for the append, then transform into an array, then transform into a binary string Rather than Create empty arrays and use its append method, then transform into a binary string. The last question on the output when then be to test the speed of usin

[Numpy-discussion] Docstring formatting

2007-02-13 Thread Pierre GM
Dear All, Did we come to some kind of agreement about the formatting of docstring ? In any case, where could I find the 'official' format that Travis recommended ? Thanks a lot in advance P. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org ht

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Charles R Harris
On 2/13/07, Mark Janikas <[EMAIL PROTECTED]> wrote: Good call Stefan, I decoupled the timing from the application (duh!) and got better results: from numpy import * import numpy.random as RAND import time as TIME x = RAND.random(1000) xl = x.tolist() t1 = TIME.clock() xStringOut = [ str(i) f

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
Good call Stefan, I decoupled the timing from the application (duh!) and got better results: from numpy import * import numpy.random as RAND import time as TIME x = RAND.random(1000) xl = x.tolist() t1 = TIME.clock() xStringOut = [ str(i) for i in xl ] xStringOut = " ".join(xStringOut) f = file

Re: [Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Stefan van der Walt
On Tue, Feb 13, 2007 at 11:42:35AM -0800, Mark Janikas wrote: > I am finding that directly packing numpy arrays into binary using the tostring > and fromstring methods do not provide a speed improvement over writing the > same > arrays to ascii files. Obviously, the size of the resulting files is

[Numpy-discussion] fromstring, tostring slow?

2007-02-13 Thread Mark Janikas
Hello all, I am finding that directly packing numpy arrays into binary using the tostring and fromstring methods do not provide a speed improvement over writing the same arrays to ascii files. Obviously, the size of the resulting files is far smaller, but I was hoping to get an improvement in

Re: [Numpy-discussion] Request for porting pycdf to NumPy

2007-02-13 Thread Konrad Hinsen
On Feb 9, 2007, at 18:33, Christopher Barker wrote: > hmmm, this page from unidata: > > http://www.unidata.ucar.edu/software/netcdf/software.html#Python > > Indicates 4-6 different Python netcfd interfaces! ... > I think it would be ideal if Unidata could be persuaded to adopt an > maintain one