[Numpy-discussion] problem during installation

2009-08-10 Thread Giuseppe Aprea
Sorry if I posted this twice. I wonder if anyone can suggest me how to fix this error which I find during numpy build: . creating build/temp.linux-i686-2.6/numpy/linalg compile options: '-DNO_ATLAS_INFO=1 -Inumpy/core/include -Ibuild/src.linux-i686-2.6/numpy/core/include/numpy -Inumpy/cor

Re: [Numpy-discussion] SWIG, numpy.i and errno: comments?

2009-08-10 Thread Bill Spotz
Sure. On Aug 9, 2009, at 12:50 PM, Egor Zindy wrote: > Bill, > > thank you for your comment. Would this do instead? (replacing the > return NULL with SWIG_fail): > > %exception > { >errno = 0; >$action > >if (errno != 0) >{ >switch(errno) >{ >case EPERM

[Numpy-discussion] Question about bounds checking

2009-08-10 Thread Rich E
Dear all, I am having a few issues with indexing in numpy and wondered if you could help me out. If I define an array a = zeros(( 4)) a array([ 0., 0., 0., 0.]) Then I try and reference a point beyond the bounds of the array a[4] Traceback (most recent call last): File "", line 1, in IndexE

Re: [Numpy-discussion] Question about bounds checking

2009-08-10 Thread Chris Colbert
when you use slice notation, [0:4] returns everything up-to but not including index 4. That is a[4] is actually the 5th element of the array (which doesn't exist) because arrays are zero-based in python. http://docs.scipy.org/doc/numpy-1.3.x/user/basics.indexing.html On Mon, Aug 10, 2009 at 11:0

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread Keith Goodman
On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: > On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 8:55 AM, wrote: >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works for >>> arbitrary

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread josef . pktd
On Mon, Aug 10, 2009 at 11:55 AM, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: >> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >>> On Thu, Aug 6, 2009 at 8:55 AM, wrote: What's the best way of getting back the correct shape to be able to broadcast, mean

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread Keith Goodman
On Mon, Aug 10, 2009 at 9:10 AM, wrote: > On Mon, Aug 10, 2009 at 11:55 AM, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: >>> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: On Thu, Aug 6, 2009 at 8:55 AM, wrote: > What's the best way of getting back the c

[Numpy-discussion] vectorize problem with f2py and gfortran 4.3

2009-08-10 Thread David Huard
Hi all, A user on the pymc user list has reported a problem with f2py wrapped fortran functions compiled with gfortran 4.3, which is the standard Ubuntu Jaunty fortran compiler. I noticed the same bug in some of my own routines. The problem, as far as I can understand, is that vectorize tries to f

[Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-10 Thread Maria Liukis
Hello everybody, I'm using following versions of Scipy and Numpy packages: >>> scipy.__version__ '0.7.1' >>> np.__version__ '1.3.0' My code uses boolean array to filter 2-dimensional array which sometimes happens to be an empty array. It seems like I have to take special care when dimension

Re: [Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-10 Thread Maria Liukis
A correction for the typo below. Thanks, Masha liu...@usc.edu On Aug 10, 2009, at 12:19 PM, Maria Liukis wrote: Hello everybody, I'm using following versions of Scipy and Numpy packages: >>> scipy.__version__ '0.7.1' >>> np.__version__ '1.3.0' My code uses boolean arra

[Numpy-discussion] speeding up getting a subset of a data array

2009-08-10 Thread Brennan Williams
Hi No doubt asked many times before so apologies I'm pulling a subset array out of a data array where I have a list of the indices I want (could be an array rather than a list actually - I have it in both). Potentially the number of points and the number of times I do this can get very la

Re: [Numpy-discussion] speeding up getting a subset of a data array

2009-08-10 Thread josef . pktd
On Mon, Aug 10, 2009 at 8:52 PM, Brennan Williams wrote: > Hi > > No doubt asked many times before so apologies > > I'm pulling a subset array out of a data array where I have a list of > the indices I want (could be an array rather than a list actually - I > have it in both). > > Potentially t

Re: [Numpy-discussion] speeding up getting a subset of a data array

2009-08-10 Thread Brennan Williams
Brennan Williams wrote: > Hi > > No doubt asked many times before so apologies > > I'm pulling a subset array out of a data array where I have a list of > the indices I want (could be an array rather than a list actually - I > have it in both). > > Potentially the number of points and the num

Re: [Numpy-discussion] speeding up getting a subset of a data array

2009-08-10 Thread Brennan Williams
josef.p...@gmail.com wrote: > On Mon, Aug 10, 2009 at 8:52 PM, Brennan > Williams wrote: > >> Hi >> >> No doubt asked many times before so apologies >> >> I'm pulling a subset array out of a data array where I have a list of >> the indices I want (could be an array rather than a list actuall

[Numpy-discussion] saving incrementally numpy arrays

2009-08-10 Thread Juan Fiol
Hi, I am creating numpy arrays in chunks and I want to save the chunks while my program creates them. I tried to use numpy.save but it failed (because it is not intended to append data). I'd like to know what is, in your opinion, the best way to go. I will put a few thousands every time but buil

Re: [Numpy-discussion] saving incrementally numpy arrays

2009-08-10 Thread David Warde-Farley
On 10-Aug-09, at 11:29 PM, Juan Fiol wrote: > Hi, I am creating numpy arrays in chunks and I want to save the > chunks while my program creates them. I tried to use numpy.save but > it failed (because it is not intended to append data). I'd like to > know what is, in your opinion, the best

Re: [Numpy-discussion] saving incrementally numpy arrays

2009-08-10 Thread Kim Hansen
I have had some resembling challenges in my work, and here appending the nympy arrays to HDF5 files using PyTables has been the solution for me - that used in combination with lzo compression/decompression has lead to very high read/write performance in my application with low memory consumption. Y