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, s

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 sui

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

[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
Hi, I have been having trouble with the following computation with numpy 1.2.rc1: Python 2.5.2 (r252:60911, Jul 14 2008, 15:20:38) [GCC 4.2.4] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from numpy import * >>> a = array([1,0,0,0,0,-1],dtype=complex) ar

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 th

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

2008-09-22 Thread Tony Yu
> > Message: 8 > Date: Mon, 22 Sep 2008 19:28:50 -0400 > From: Pierre GM <[EMAIL PROTECTED]> > Subject: Re: [Numpy-discussion] array with named columns (or record > arrays with homogenous types) > To: Discussion of Numerical Python > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plai

Re: [Numpy-discussion] loadtxt error

2008-09-22 Thread Pierre GM
On Monday 22 September 2008 19:56:47 frank wang wrote: > This error is caused that the usecols is a tuple and it does not have find > command. I do not know how to fix this problem. Try to use a list instead of a tuple as a quick-fix. Anyway, Frank, you should try to give us the version of numpy y

Re: [Numpy-discussion] loadtxt error

2008-09-22 Thread frank wang
This error is caused that the usecols is a tuple and it does not have find command. I do not know how to fix this problem. Thanks Frank From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Mon, 22 Sep 2008 15:27:13 -0600Subject: Re: [Numpy-discussion] loadtxt error Hi, Stefan, Thanks for your he

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

2008-09-22 Thread Pierre GM
On Monday 22 September 2008 19:25:16 Tony S Yu wrote: > >>> import numpy as np > >>> > >>> color = np.array([(1, 2, 3), (4, 5, 6)], > > ... dtype=[('r', ' # get the average (grayscale) of the first row > > >>> color[0].mean() What about color.view((float,3))[0].mean() ?

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

2008-09-22 Thread Tony S Yu
Is there any way to name the columns of an array so that they can be called with a string, but still used like an ordinary array? What I have in mind is very similar to a record array, but with homogenous types. Having different types implies that certain operations (e.g., mean, sum) don't

Re: [Numpy-discussion] loadtxt error

2008-09-22 Thread frank wang
Hi, Stefan, Thanks for your help. First it is my typing error. My command is:fid=loadtxt('filename.csv',comments='"',dtype='|S4',converters={1:lambdas:int(s,16)},usecols=(1,)) It is not the zero. This will causes the same error as: In [218]: fid=loadtxt('test.dat',comments='"',dtype='|S4',c

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

2008-09-22 Thread Gael Varoquaux
On Mon, Sep 22, 2008 at 10:34:12PM +0200, Stéfan van der Walt wrote: > 2008/9/22 Robert Kern <[EMAIL PROTECTED]>: > > Agreed. Please don't change this behavior even through a deprecation. > Are you OK with the functionality in the patch that returns the mixed > grid as a tuple but keeps the hetero

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

2008-09-22 Thread Stéfan van der Walt
2008/9/22 Robert Kern <[EMAIL PROTECTED]>: > Agreed. Please don't change this behavior even through a deprecation. Are you OK with the functionality in the patch that returns the mixed grid as a tuple but keeps the heterogeneous grid as is? Stéfan ___ N

[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 pro

Re: [Numpy-discussion] loadtxt error

2008-09-22 Thread Stéfan van der Walt
2008/9/22 frank wang <[EMAIL PROTECTED]>: > It will load an array has two columns. However, I only want to load one > column to save the memory. If I type > > fid=loadtxt('filename.csv',comments='"',dtype='|S4',converters={0:lambda > s:int(s,16)},usecols=(1,)) You are specifying a converter that w

[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.

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 =

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

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

2008-09-22 Thread Robert Kern
On Mon, Sep 22, 2008 at 10:18, John Hunter <[EMAIL PROTECTED]> wrote: > 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.

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

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 m

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 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 = np.random.r

[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 = np.nonzero(np.r

[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

Re: [Numpy-discussion] Medians that ignore values

2008-09-22 Thread Peter Saffrey
David Cournapeau 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 I a

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: w

[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 Peter Saffrey
David Cournapeau 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 which

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 ca

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

2008-09-22 Thread Stéfan van der Walt
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 plan should be to eventually have it > always return a list as that i