Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-21 Thread Ralf Gommers
On Tue, Jun 21, 2011 at 3:55 AM, Bruce Southey bsout...@gmail.com wrote: On Mon, Jun 20, 2011 at 2:43 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Mon, Jun 20, 2011 at 8:50 PM, Bruce Southey bsout...@gmail.com wrote: I copied the files but that just moves the problem. So

[Numpy-discussion] faster in1d() for monotonic case?

2011-06-21 Thread Michael Katz
The following call is a bottleneck for me:     np.in1d( large_array.field_of_interest, values_of_interest ) I'm not sure how in1d() is implemented, but this call seems to be slower than O(n) and faster than O( n**2 ), so perhaps it sorts the values_of_interest and does a binary search for each

[Numpy-discussion] Controlling endianness of ndarray.tofile()

2011-06-21 Thread Ben Forbes
Hi, On my system (Intel Xeon, Windows 7 64-bit), ndarray.tofile() outputs in little-endian. This is a bit inconvenient, since everything else I do is in big-endian. Unfortunately, scipy.io.write_arrray() is deprecated, and I can't find any other routines that write pure raw binary. Are there any

[Numpy-discussion] תשובה: faster in1d() for monotonic case?

2011-06-21 Thread Nadav Horesh
Did you try searchsorted? Nadav מאת: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] בשם Michael Katz נשלח: Tuesday, June 21, 2011 10:06 אל: Discussion of Numerical Python נושא: [Numpy-discussion] faster in1d() for monotonic

Re: [Numpy-discussion] Controlling endianness of ndarray.tofile()

2011-06-21 Thread gary ruben
Hi Ben, based on this example https://bitbucket.org/lannybroo/numpyio/src/a6191c989804/numpyIO.py I suspect the way to do it is with numpy.byteswap() and numpy.tofile() From http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.byteswap.html we can do A = np.array([1, 256, 8755],

Re: [Numpy-discussion] Controlling endianness of ndarray.tofile()

2011-06-21 Thread Ben Forbes
Thanks Gary, that works. Out of interest I timed it: http://pastebin.com/HA4Qn9Ge On average the swapping incurred a 0.04 second penalty (compared with 1.5 second total run time) for a 4096x4096 array of 64-bit reals. So there is no real penalty. Cheers, Ben On Tue, Jun 21, 2011 at 8:37 PM,

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-21 Thread Bruce Southey
On 06/21/2011 01:01 AM, Ralf Gommers wrote: On Tue, Jun 21, 2011 at 3:55 AM, Bruce Southey bsout...@gmail.com mailto:bsout...@gmail.com wrote: On Mon, Jun 20, 2011 at 2:43 PM, Ralf Gommers ralf.gomm...@googlemail.com mailto:ralf.gomm...@googlemail.com wrote: On

Re: [Numpy-discussion] תשובה: faster in1d() for monotonic case?

2011-06-21 Thread Michael Katz
I'm not quite sure how to use searchsorted to get the output I need (e.g., the length of the output needs to be as long as large_array). But in any case it says it uses binary search, so it would seem to be an O( n * log( n ) ) solution, whereas I'm hoping for an O( n ) solution.

[Numpy-discussion] poor performance of sum with sub-machine-word integer types

2011-06-21 Thread Zachary Pincus
Hello all, As a result of the fast greyscale conversion thread, I noticed an anomaly with numpy.ndararray.sum(): summing along certain axes is much slower with sum() than versus doing it explicitly, but only with integer dtypes and when the size of the dtype is less than the machine word. I

Re: [Numpy-discussion] poor performance of sum with sub-machine-word integer types

2011-06-21 Thread Charles R Harris
On Tue, Jun 21, 2011 at 10:46 AM, Zachary Pincus zachary.pin...@yale.eduwrote: Hello all, As a result of the fast greyscale conversion thread, I noticed an anomaly with numpy.ndararray.sum(): summing along certain axes is much slower with sum() than versus doing it explicitly, but only with

Re: [Numpy-discussion] poor performance of sum with sub-machine-word integer types

2011-06-21 Thread Keith Goodman
On Tue, Jun 21, 2011 at 9:46 AM, Zachary Pincus zachary.pin...@yale.edu wrote: Hello all, As a result of the fast greyscale conversion thread, I noticed an anomaly with numpy.ndararray.sum(): summing along certain axes is much slower with sum() than versus doing it explicitly, but only with

Re: [Numpy-discussion] poor performance of sum with sub-machine-word integer types

2011-06-21 Thread Charles R Harris
On Tue, Jun 21, 2011 at 11:17 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Jun 21, 2011 at 9:46 AM, Zachary Pincus zachary.pin...@yale.edu wrote: Hello all, As a result of the fast greyscale conversion thread, I noticed an anomaly with numpy.ndararray.sum(): summing along certain

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Charles R Harris
On Mon, Jun 20, 2011 at 12:32 PM, Mark Wiebe mwwi...@gmail.com wrote: NumPy has a mechanism built in to allow subclasses to adjust or override aspects of the ufunc behavior. While this goal is important, this mechanism only allows for very limited customization, making for instance the masked

Re: [Numpy-discussion] poor performance of sum with sub-machine-word integer types

2011-06-21 Thread Zachary Pincus
On Jun 21, 2011, at 1:16 PM, Charles R Harris wrote: It's because of the type conversion sum uses by default for greater precision. Aah, makes sense. Thanks for the detailed explanations and timings! ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Neal Becker
Neal Becker wrote: I'm wondering what are good choices for fast numpy array serialization? mmap: fast, but I guess not self-describing? hdf5: ? pickle: self-describing, but maybe not fast? others? I think, in addition, that hdf5 is the only one that easily interoperates with matlab?

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Robert Kern
On Tue, Jun 21, 2011 at 12:49, Neal Becker ndbeck...@gmail.com wrote: I'm wondering what are good choices for fast numpy array serialization? mmap: fast, but I guess not self-describing? hdf5: ? pickle: self-describing, but maybe not fast? others? NPY:

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Christopher Barker
Neal Becker wrote: I'm wondering what are good choices for fast numpy array serialization? mmap: fast, but I guess not self-describing? hdf5: ? Should be pretty fast, and self describing -- advantage of being a standard. Disadvantage is that it requires an hdf5 library, which can b a pain

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Mark Wiebe
On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 20, 2011 at 12:32 PM, Mark Wiebe mwwi...@gmail.com wrote: NumPy has a mechanism built in to allow subclasses to adjust or override aspects of the ufunc behavior. While this goal is important,

Re: [Numpy-discussion] what python module to handle csv?

2011-06-21 Thread A. Flaxman
I am a huge fan of rec2csv and csv2rec, which might not technically be part of numpy, and can be found in pylab or the matplotlib.mlab module. --Abie From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Olivier Delalleau Sent: Wednesday, June 15,

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Christopher Barker
Neal Becker wrote: I'm wondering what are good choices for fast numpy array serialization? mmap: fast, but I guess not self-describing? hdf5: ? pickle: self-describing, but maybe not fast? others? I think, in addition, that hdf5 is the only one that easily interoperates with matlab?

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Derek Homeier
On 21.06.2011, at 7:58PM, Neal Becker wrote: I think, in addition, that hdf5 is the only one that easily interoperates with matlab? speaking of hdf5, I see: pyhdf5io 0.7 - Python module containing high-level hdf5 load and save functions. h5py 2.0.0 - Read and write HDF5 files from

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Charles R Harris
On Tue, Jun 21, 2011 at 11:57 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 20, 2011 at 12:32 PM, Mark Wiebe mwwi...@gmail.com wrote: NumPy has a mechanism built in to allow subclasses to adjust or

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Simon Lyngby Kokkendorff
Hi, I have been using h5py a lot (both on windows and Mac OSX) and can only recommend it- haven't tried the other options though Cheers, Simon On Tue, Jun 21, 2011 at 8:24 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: On 21.06.2011, at 7:58PM, Neal Becker wrote: I

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Christopher Barker
Robert Kern wrote: https://raw.github.com/numpy/numpy/master/doc/neps/npy-format.txt Just a note. From that doc: HDF5 is a complicated format that more or less implements a hierarchical filesystem-in-a-file. This fact makes satisfying some of the Requirements difficult. To the

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Darren Dale
On Tue, Jun 21, 2011 at 2:28 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Jun 21, 2011 at 11:57 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 20, 2011 at 12:32 PM, Mark Wiebe

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Charles R Harris
On Tue, Jun 21, 2011 at 12:46 PM, Darren Dale dsdal...@gmail.com wrote: On Tue, Jun 21, 2011 at 2:28 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Jun 21, 2011 at 11:57 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris

[Numpy-discussion] (cumsum, broadcast) in (numexpr, weave)

2011-06-21 Thread srean
Hi All, is there a fast way to do cumsum with numexpr ? I could not find it, but the functions available in numexpr does not seem to be exhaustively documented, so it is possible that I missed it. Do not know if 'sum' takes special arguments that can be used. To try another track, does numexpr

Re: [Numpy-discussion] (cumsum, broadcast) in (numexpr, weave)

2011-06-21 Thread srean
Apologies, intended to send this to the scipy list. On Tue, Jun 21, 2011 at 2:35 PM, srean srean.l...@gmail.com wrote: Hi All,  is there a fast way to do cumsum with numexpr ? I could not find it, but the functions available in numexpr does not seem to be exhaustively documented, so it is

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-21 Thread Ralf Gommers
On Tue, Jun 21, 2011 at 4:38 PM, Bruce Southey bsout...@gmail.com wrote: ** On 06/21/2011 01:01 AM, Ralf Gommers wrote: On Tue, Jun 21, 2011 at 3:55 AM, Bruce Southey bsout...@gmail.com wrote: On Mon, Jun 20, 2011 at 2:43 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Mon,

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-21 Thread Ralf Gommers
On Tue, Jun 21, 2011 at 10:05 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Tue, Jun 21, 2011 at 4:38 PM, Bruce Southey bsout...@gmail.com wrote: ** On 06/21/2011 01:01 AM, Ralf Gommers wrote: On Tue, Jun 21, 2011 at 3:55 AM, Bruce Southey bsout...@gmail.comwrote: So what is

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Mark Wiebe
On Tue, Jun 21, 2011 at 1:28 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Jun 21, 2011 at 11:57 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 20, 2011 at 12:32 PM, Mark Wiebe

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-21 Thread Mark Wiebe
On Tue, Jun 21, 2011 at 1:46 PM, Darren Dale dsdal...@gmail.com wrote: On Tue, Jun 21, 2011 at 2:28 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Jun 21, 2011 at 11:57 AM, Mark Wiebe mwwi...@gmail.com wrote: On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris

[Numpy-discussion] fast SSD

2011-06-21 Thread Alex Flint
Is there a fast way to compute an array of sum-of-squared-differences between a (small) K x K array and all K x K sub-arrays of a larger array? (i.e. each element x,y in the output array is the SSD between the small array and the sub-array (x:x+K, y:y+K) My current implementation loops over each

Re: [Numpy-discussion] fast SSD

2011-06-21 Thread Keith Goodman
On Tue, Jun 21, 2011 at 5:09 PM, Alex Flint alex.fl...@gmail.com wrote: Is there a fast way to compute an array of sum-of-squared-differences between a (small)  K x K array and all K x K sub-arrays of a larger array? (i.e. each element x,y in the output array is the SSD between the small array

Re: [Numpy-discussion] fast SSD

2011-06-21 Thread Warren Weckesser
On Tue, Jun 21, 2011 at 7:09 PM, Alex Flint alex.fl...@gmail.com wrote: Is there a fast way to compute an array of sum-of-squared-differences between a (small) K x K array and all K x K sub-arrays of a larger array? (i.e. each element x,y in the output array is the SSD between the small

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-21 Thread Bruce Southey
On Tue, Jun 21, 2011 at 3:52 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Tue, Jun 21, 2011 at 10:05 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Tue, Jun 21, 2011 at 4:38 PM, Bruce Southey bsout...@gmail.com wrote: On 06/21/2011 01:01 AM, Ralf Gommers wrote: On Tue,