Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-22 Thread Gael Varoquaux
On Mon, Sep 22, 2008 at 09:40:42AM +0200, Stéfan van der Walt wrote: 2008/9/19 David M. Kaplan [EMAIL PROTECTED]: My 2 cents - I personally think the version that always returns a list will ultimately be more transparent and cause fewer problems than the newer version. In either case, the

Re: [Numpy-discussion] Medians that ignore values

2008-09-22 Thread Peter Saffrey
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Still, it is indeed really slow for your case; when I fixed nanmean and co, I did not know much about numpy, I just wanted them to give the right answer :) I think this can be made faster, specially for your case (where the axis along

[Numpy-discussion] numpy.scipy.org and Travis' book

2008-09-22 Thread Peter
Hi all, Now that Travis' book is freely available, it is great to see the NumPy section of http://www.scipy.org/Documentation has been updated. However, could someone update the main numpy webpage (numpy.scipy.org) too? Quoting http://numpy.scipy.org/ Much of the documentation for Numeric and

Re: [Numpy-discussion] Medians that ignore values

2008-09-22 Thread David Cournapeau
Peter Saffrey wrote: I've found that if I just cut nans from the list and use regular numpy median, it is quicker - 10 times slower than list median, rather than 35 times slower. Could you just wire nanmedian to do it this way? Unfortunately, we can't, because we would loose generality: we

Re: [Numpy-discussion] Medians that ignore values

2008-09-22 Thread Peter Saffrey
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Unfortunately, we can't, because we would loose generality: we need to compute median on any axis, not only the last one. The proper solution would be to have a sort/max/min/etc... which knows about nan in numpy, which is what Chuck and

[Numpy-discussion] Proceedings of the SciPy conference.

2008-09-22 Thread Gael Varoquaux
The SciPy conference proceedings are finally available online: http://conference.scipy.org/proceedings/SciPy2008 . I hope you enjoy them. I find it great to have this set of excellent articles talking about works done with, or for, Python in science. For me, it is a reference to remember what was

[Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
I have a an array of indices into a larger array where some condition is satisfied. I want to create a larger set of indices which *mark* all the indicies following the condition over some Nmark length window. In code: import numpy as np N = 1000 Nmark = 20 ind =

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread Fabrice Silva
Le lundi 22 septembre 2008 à 09:41 -0500, John Hunter a écrit : I have a an array of indices into a larger array where some condition is satisfied. I want to create a larger set of indices which *mark* all the indicies following the condition over some Nmark length window. A =

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread Robert Kern
On Mon, Sep 22, 2008 at 09:41, John Hunter [EMAIL PROTECTED] wrote: I have a an array of indices into a larger array where some condition is satisfied. I want to create a larger set of indices which *mark* all the indicies following the condition over some Nmark length window. In code:

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
On Mon, Sep 22, 2008 at 10:13 AM, Robert Kern [EMAIL PROTECTED] wrote: marked[ind + np.arange(Nmark)] = True That triggers a broadcasting error: Traceback (most recent call last): File /home/titan/johnh/test.py, line 13, in ? marked3[ind + np.arange(Nmark)] = True ValueError: shape

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-22 Thread Robert Kern
On Mon, Sep 22, 2008 at 03:53, Gael Varoquaux [EMAIL PROTECTED] wrote: On Mon, Sep 22, 2008 at 09:40:42AM +0200, Stéfan van der Walt wrote: 2008/9/19 David M. Kaplan [EMAIL PROTECTED]: My 2 cents - I personally think the version that always returns a list will ultimately be more transparent

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread Robert Kern
On Mon, Sep 22, 2008 at 10:22, Robert Kern [EMAIL PROTECTED] wrote: ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark).flat).clip(0, N-1) marked[ind2mark] = True Missing parenthesis: ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark)).flat).clip(0, N-1) -- Robert Kern I

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
On Mon, Sep 22, 2008 at 10:23 AM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Sep 22, 2008 at 10:22, Robert Kern [EMAIL PROTECTED] wrote: ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark).flat).clip(0, N-1) marked[ind2mark] = True Missing parenthesis: ind2mark =

[Numpy-discussion] loadtxt error

2008-09-22 Thread frank wang
Hi, All, I am struggling to make the loadtxt works. In my file, I have several colunms of data, say I have two. When I use the following command to load the data, fid=loadtxt('filename.csv',comments='',dtype='|S4',converters={0:lambda s:int(s,16)}) It will load an array has two columns.

[Numpy-discussion] ANN: Enthought Python Distribution 4.0.300 Beta 2 available

2008-09-22 Thread Travis Vaught
Greetings, We've recently posted the second beta release of the Enthought Python Distribution (EPD) for our upcoming general release of version 4.0.300 with Python 2.5. You may download the beta from here: http://www.enthought.com/products/epdbeta.php Please feel free to test it out and

Re: [Numpy-discussion] array with named columns (or record arrays with homogenous types)

2008-09-22 Thread Pierre GM
On Tuesday 23 September 2008 00:06:14 Tony Yu wrote: BTW, is the tuple argument you use with `view` documented anywhere; I haven't seen it before and a quick search doesn't give any results. http://www.scipy.org/RecordArrays + Travis O.'s numpy book, the chapter on dtype (pp. 137-138) Note

Re: [Numpy-discussion] complex roots() segfault on Solaris 10/x86 with numpy 1.2.rc1 using python 2.5.2

2008-09-22 Thread David Cournapeau
Michael Abshoff wrote: This is python 2.5.2 build with gcc 4.2.4, numpy itself is build with -O0, i.e. this is unlikely to be a compiler bug IMHO. This bug has been present in 1.0.4, 1.1.0 and it seems unfixed in 1.2.rc1. The numpy 1.1 test suite passed with that install, I did not run the

Re: [Numpy-discussion] complex roots() segfault on Solaris 10/x86 with numpy 1.2.rc1 using python 2.5.2

2008-09-22 Thread Michael Abshoff
David Cournapeau wrote: Michael Abshoff wrote: Hi David, This is python 2.5.2 build with gcc 4.2.4, numpy itself is build with -O0, i.e. this is unlikely to be a compiler bug IMHO. This bug has been present in 1.0.4, 1.1.0 and it seems unfixed in 1.2.rc1. The numpy 1.1 test suite passed

Re: [Numpy-discussion] complex roots() segfault on Solaris 10/x86 with numpy 1.2.rc1 using python 2.5.2

2008-09-22 Thread David Cournapeau
Michael Abshoff wrote: Sorry for not being precise: Both python and numpy have been build with OPT=-DNDEBUG -g -O0 -fwrapv -Wall -Wstrict-prototypes Hm, strange. I don't know why you can't get any debug info, then. i.e. -O0 instead of -O3. I am using ATLAS and netlib.org Lapack, so I