Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Alan G Isaac
On 12/2/2008 7:21 AM Joris De Ridder apparently wrote: As a historical note, we used to have scipy.io.read_array which at the time was considered by Travis too slow and too grandiose to be put in Numpy. As a consequence, numpy.loadtxt() was created which was simple and fast. Now it

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Alan G Isaac
On 12/2/2008 8:12 AM Alan G Isaac apparently wrote: I hope this consideration remains prominent in this thread. Is the disappearance or read_array the reason for this change? What happened to it? Apologies; it is only deprecated, not gone. Alan Isaac

Re: [Numpy-discussion] bug in ma.masked_all()?

2008-12-02 Thread Eric Firing
Pierre GM wrote: Eric, That's quite a handful you have with this dtype... Here is a simplified example of how I made it: dt = np.dtype({'names': ['a','b'], 'formats': ['f', 'f'], 'titles': ['aaa', 'bbb']}) From page 132 in the numpy book: The fields dictionary is indexed by keys that are

Re: [Numpy-discussion] bug in ma.masked_all()?

2008-12-02 Thread Pierre GM
Eric, That's quite a handful you have with this dtype... So yes, the fix I gave works with nested dtypes and flexible dtypes with a simple name (string, not tuple). I'm a bit surprised with numpy, here. Consider: dt.names ('P', 'D', 'T', 'w', 'S', 'sigtheta', 'theta') So we lose the

[Numpy-discussion] [F2PY] Fortran call fails in IDLE / PyScripter

2008-12-02 Thread Christophe Chappet
Hi all, I compile the followinq code using f2py -c --fcompiler=gnu95 --compiler=mingw32 -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end Using python console : import hello hello.affichemessage( Hello) works fine ! I do

Re: [Numpy-discussion] fast way to convolve a 2d array with 1d filter

2008-12-02 Thread Nadav Horesh
You can use 2D convolution routines either in scipy.signal or numpy.numarray.nd_image Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם frank wang נשלח: ג 02-דצמבר-08 03:38 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] fast way to convolve a 2d array with 1d filter Hi, I

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Joris De Ridder
On 1 Dec 2008, at 21:47 , Stéfan van der Walt wrote: Hi Pierre 2008/12/1 Pierre GM [EMAIL PROTECTED]: * `genloadtxt` is the base function that makes all the work. It outputs 2 arrays, one for the data (missing values being substituted by the appropriate default) and one for the mask. It

Re: [Numpy-discussion] bug in ma.masked_all()?

2008-12-02 Thread Pierre GM
On Dec 2, 2008, at 4:26 AM, Eric Firing wrote: From page 132 in the numpy book: The fields dictionary is indexed by keys that are the names of the fields. Each entry in the dictionary is a tuple fully describing the field: (dtype, offset[,title]). If present, the optional title can

Re: [Numpy-discussion] [F2PY] Fortran call fails in IDLE / PyScripter

2008-12-02 Thread josef . pktd
On Tue, Dec 2, 2008 at 9:26 AM, Christophe Chappet [EMAIL PROTECTED] wrote: Hi all, I compile the followinq code using f2py -c --fcompiler=gnu95 --compiler=mingw32 -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end

Re: [Numpy-discussion] bug in ma.masked_all()?

2008-12-02 Thread Eric Firing
Pierre GM wrote: On Dec 2, 2008, at 1:59 AM, Eric Firing wrote: Pierre, Your change fixed masked_all for the example I gave, but I think it introduced a new failure in zeros: Eric, Would you mind giving r6131 a try ? It's rather ugly but looks like it works... So far, so good.

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Zachary Pincus
Hi Pierre, I've tested the new loadtxt briefly. Looks good, except that there's a minor bug when trying to use a specific white-space delimiter (e.g. \t) while still allowing other white-space to be allowed in fields (e.g. spaces). Specifically, on line 115 in LineSplitter, we have:

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Ryan May
Zachary Pincus wrote: Specifically, on line 115 in LineSplitter, we have: self.delimiter = delimiter.strip() or None so if I pass in, say, '\t' as the delimiter, self.delimiter gets set to None, which then causes the default behavior of any-whitespace-is- delimiter to be used.

Re: [Numpy-discussion] [F2PY] Fortran call fails in IDLE / PyScripter

2008-12-02 Thread Robert Kern
On Tue, Dec 2, 2008 at 08:26, Christophe Chappet [EMAIL PROTECTED] wrote: Hi all, I compile the followinq code using f2py -c --fcompiler=gnu95 --compiler=mingw32 -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Ryan May
Pierre GM wrote: Well, looks like the attachment is too big, so here's the implementation. The tests will come in another message. A couple of quick nitpicks: 1) On line 186 (in the NameValidator class), you use excludelist.append() to append a list to the end of a list. I think you meant

Re: [Numpy-discussion] ANN: HDF5 for Python 1.0

2008-12-02 Thread Andrew Collette
Just FYI, the Windows installer for 1.0 is now posted at h5py.googlecode.com after undergoing some final testing. Thanks for trying 0.3.0... too bad about matlab. Andrew On Mon, 2008-12-01 at 21:53 -0500, [EMAIL PROTECTED] wrote: Requires * UNIX-like platform (Linux or Mac OS-X);

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Pierre GM
On Dec 2, 2008, at 3:12 PM, Ryan May wrote: Pierre GM wrote: Well, looks like the attachment is too big, so here's the implementation. The tests will come in another message. A couple of quick nitpicks: 1) On line 186 (in the NameValidator class), you use excludelist.append() to append a

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Christopher Barker
Pierre GM wrote: I think that treating an explicitly-passed-in ' ' delimiter as identical to 'no delimiter' is a bad idea. If I say that ' ' is the delimiter, or '\t' is the delimiter, this should be treated *just* like ',' being the delimiter, where the expected output is: ['1', '2', '3',

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Pierre GM
Chris, I can try, but in that case, please write me a unittest, so that I have a clear and unambiguous idea of what you expect. ANFSCD, have you tried the missing_values option ? On Dec 2, 2008, at 5:36 PM, Christopher Barker wrote: Pierre GM wrote: I think that treating an

Re: [Numpy-discussion] ANN: HDF5 for Python 1.0

2008-12-02 Thread Andrew Collette
If it's a feature people want, I certainly wouldn't mind looking in to it. I believe PyTables supports bzip2 as well. Adding filters to HDF5 takes a bit of work but is well supported by the library. Andrew On Tue, 2008-12-02 at 22:53 +0100, Stephen Simmons wrote: Do you have any plans to add

[Numpy-discussion] PyArray_EMPTY and Cython

2008-12-02 Thread Gabriel Gellner
After some discussion on the Cython lists I thought I would try my hand at writing some Cython accelerators for empty and zeros. This will involve using PyArray_EMPTY, I have a simple prototype I would like to get working, but currently it segfaults. Any tips on what I might be missing? import