Re: [Numpy-discussion] npy_log2 undefined on Linux

2014-10-26 Thread David Cournapeau
Not exactly: if you build numpy with mingw (as is the official binary), you need to build everything that uses numpy C API with it. On Sun, Oct 26, 2014 at 1:22 AM, Matthew Brett matthew.br...@gmail.com wrote: On Sat, Oct 25, 2014 at 2:15 PM, Matthew Brett matthew.br...@gmail.com wrote: On

[Numpy-discussion] Subdividing NumPy array into Regular Grid

2014-10-26 Thread Artur Bercik
I have a rectangle with the following coordinates: import numpy as np ulx,uly = (110, 60) ##uppper left lon, upper left lat urx,ury = (120, 60) ##uppper right lon, upper right lat lrx, lry = (120, 50) ##lower right lon, lower right lat llx, lly = (110, 50) ##lower left lon, lower left lat I

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Jeff Reback
you should have a read here/ http://wesmckinney.com/blog/?p=543 going below the 2x memory usage on read in is non trivial and costly in terms of performance On Oct 26, 2014, at 4:46 AM, Saullo Castro saullogiov...@gmail.com wrote: I would like to start working on a memory efficient

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Eelco Hoogendoorn
Im not sure why the memory doubling is necessary. Isnt it possible to preallocate the arrays and write to them? I suppose this might be inefficient though, in case you end up reading only a small subset of rows out of a mostly corrupt file? But that seems to be a rather uncommon corner case.

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Robert Kern
On Sun, Oct 26, 2014 at 1:21 PM, Eelco Hoogendoorn hoogendoorn.ee...@gmail.com wrote: Im not sure why the memory doubling is necessary. Isnt it possible to preallocate the arrays and write to them? Not without reading the whole file first to know how many rows to preallocate. -- Robert Kern

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Daπid
On 26 October 2014 12:54, Jeff Reback jeffreb...@gmail.com wrote: you should have a read here/ http://wesmckinney.com/blog/?p=543 going below the 2x memory usage on read in is non trivial and costly in terms of performance If you know in advance the number of rows (because it is in the

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Derek Homeier
On 26 Oct 2014, at 02:21 pm, Eelco Hoogendoorn hoogendoorn.ee...@gmail.com wrote: Im not sure why the memory doubling is necessary. Isnt it possible to preallocate the arrays and write to them? I suppose this might be inefficient though, in case you end up reading only a small subset of

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Jeff Reback
you are describing a special case where you know the data size apriori (eg not streaming), dtypes are readily apparent from a small sample case and in general your data is not messy I would agree if these can be satisfied then you can achieve closer to a 1x memory overhead using bcolZ is

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Nathaniel Smith
On 26 Oct 2014 11:54, Jeff Reback jeffreb...@gmail.com wrote: you should have a read here/ http://wesmckinney.com/blog/?p=543 going below the 2x memory usage on read in is non trivial and costly in terms of performance On Linux you can probably go below 2x overhead easily, by exploiting the

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Daniele Nicolodi
On 26/10/14 09:46, Saullo Castro wrote: I would like to start working on a memory efficient alternative for np.loadtxt and np.genfromtxt that uses arrays instead of lists to store the data while the file iterator is exhausted. ... I would be glad if you could share your experience on this

[Numpy-discussion] ANN: NumPy 1.9.1 release candidate

2014-10-26 Thread Julian Taylor
Hi, We have finally finished the first release candidate of NumOy 1.9.1, sorry for the week delay. The 1.9.1 release will as usual be a bugfix only release to the 1.9.x series. The tarballs and win32 binaries are available on sourceforge:

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Saullo Castro
I agree with @Daniele's point, storing huge arrays in text files migh indicate a bad process but once these functions can be improved, why not? Unless this turns to be a burden to change. Regarding the estimation of the array size, I don't see a big performance loss when the file iterator is

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread RayS
At 06:32 AM 10/26/2014, you wrote: On Sun, Oct 26, 2014 at 1:21 PM, Eelco Hoogendoorn hoogendoorn.ee...@gmail.com wrote: Im not sure why the memory doubling is necessary. Isnt it possible to preallocate the arrays and write to them? Not without reading the whole file first to know how many

Re: [Numpy-discussion] Subdividing NumPy array into Regular Grid

2014-10-26 Thread Paul Hobson
I think you want np.meshgrid -paul On Sun, Oct 26, 2014 at 2:09 AM, Artur Bercik vbubbl...@gmail.com wrote: I have a rectangle with the following coordinates: import numpy as np ulx,uly = (110, 60) ##uppper left lon, upper left lat urx,ury = (120, 60) ##uppper right lon, upper right lat