[Numpy-discussion] Single precision equivalents of missing C99 functions

2009-06-01 Thread Francesc Alted
Hi, In the process of adding single precision support to Numexpr, I'm experimenting a divergence between Numexpr and NumPy computations. It all boils down to the fact that my implementation defined single precision functions completely. As for one, consider my version of expm1f: inline

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 00:05, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: I think we should just fix it to use conjugate - I will do this in the branch, and I will integrate it in the trunk later unless someone stands up vehemently against the change. I opened up a ticket to track

[Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Michael Hearne
A question (and possibly a bug): What should be returned when I do: numpy.nansum([]) In my copy of numpy 1.1.1, I get 0.0. This is what I would expect to see. However, this behavior seems to have changed in 1.3.0, in which I get nan. Thanks, Mike

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Keith Goodman
On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne mhea...@usgs.gov wrote: A question (and possibly a bug): What should be returned when I do: numpy.nansum([]) In my copy of numpy 1.1.1, I get 0.0.  This is what I would expect to see. However, this behavior seems to have changed in 1.3.0, in

Re: [Numpy-discussion] setmember1d_nu

2009-06-01 Thread Neil Crighton
Robert Cimrman cimrman3 at ntc.zcu.cz writes: Re-hi! Robert Cimrman wrote: Hi all, I have added to the ticket [1] a script that compares the proposed setmember1d_nu() implementations of Neil and Kim. Comments are welcome! [1] http://projects.scipy.org/numpy/ticket/1036 I

Re: [Numpy-discussion] Single precision equivalents of missing C99 functions

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 10:22 AM, Francesc Alted fal...@pytables.org wrote: Hi, In the process of adding single precision support to Numexpr, I'm experimenting a divergence between Numexpr and NumPy computations. It all boils down to the fact that my implementation defined single precision

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Keith Goodman
On Mon, Jun 1, 2009 at 11:16 AM, josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne mhea...@usgs.gov wrote: A question (and possibly a bug): What should be returned when I do: numpy.nansum([])

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 2:26 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:16 AM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne mhea...@usgs.gov wrote: A question (and

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 11:48 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern robert.k...@gmail.comwrote: On Mon, Jun 1, 2009 at 00:05, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: I think we should just fix it to use conjugate -

Re: [Numpy-discussion] Rasterizing points onto an array

2009-06-01 Thread Thomas Robitaille
Nathan Bell-4 wrote: image = np.histogram2d(x, y, bins=bins, weights=z)[0] This works great - thanks! Thomas -- View this message in context: http://www.nabble.com/Rasterizing-points-onto-an-array-tp23808494p23820216.html Sent from the Numpy-discussion mailing list archive at

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 13:44, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:48 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 00:05, David Cournapeau

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 2:45 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:34 AM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 2:26 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 11:16 AM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac ais...@american.edu wrote: On 6/1/2009 3:38 PM josef.p...@gmail.com apparently wrote: Here's a good one: np.isnan([]).all() True np.isnan([]).any() False   all([]) True   any([]) False also: y array([], dtype=float64) (y0).all() True

[Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Chris Colbert
On 64-bit ubuntu 9.04 and Python 2.6, I built numpy from source against atlas and lapack (everything 64bit). To install, I used: sudo python setup.py install --prefix /usr/local but then python doesnt find the numpy module, even though it exists in /usr/local/lib/python2.6/site-packages Do I

Re: [Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Skipper Seabold
On Mon, Jun 1, 2009 at 4:37 PM, Chris Colbert sccolb...@gmail.com wrote: On 64-bit ubuntu 9.04 and Python 2.6, I built numpy from source against atlas and lapack (everything 64bit). To install, I used:   sudo python setup.py install --prefix /usr/local but then python doesnt find the numpy

Re: [Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Chris Colbert
building without the prefix flag works for me as well, just wondering why this doesnt... Chris On Mon, Jun 1, 2009 at 4:47 PM, Skipper Seabold jsseab...@gmail.com wrote: On Mon, Jun 1, 2009 at 4:37 PM, Chris Colbert sccolb...@gmail.com wrote: On 64-bit ubuntu 9.04 and Python 2.6, I built

Re: [Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Chris Colbert
thanks Robert, the directory indeed wasnt in the $PATH variable. Cheers, Chris On Mon, Jun 1, 2009 at 5:12 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 15:37, Chris Colbert sccolb...@gmail.com wrote: On 64-bit ubuntu 9.04 and Python 2.6, I built numpy from source

Re: [Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 16:35, Chris Colbert sccolb...@gmail.com wrote: thanks Robert, the directory indeed wasnt in the $PATH variable. No, not the environment variable $PATH, but sys.path. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is

Re: [Numpy-discussion] When building with --prefix /usr/local numpy not detected by python

2009-06-01 Thread Chris Colbert
the directory wasn't on the python path either. I added a site-packages.pth file to /usr/local/lib/python2.6/dist-packages with the line /usr/local/lib/python2.6/site-packages Not elegant, but it worked. Chris On Mon, Jun 1, 2009 at 5:44 PM, Chris Colbert sccolb...@gmail.com wrote: yeah, I

[Numpy-discussion] Slices of structured arrays

2009-06-01 Thread Robert Ferrell
Is there a way to get slices of a structured array and keep the field names? For instance, I've got dtype=[('x','f4'),('y','f4'), ('z','f4')] and I want to get just the x y slices into a new array with dtype=[('x','f4'),('y','f4')]. I can just make a new dtype, and extract what I need, but

Re: [Numpy-discussion] Slices of structured arrays

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 17:32, Robert Ferrell ferr...@diablotech.com wrote: Is there a way to get slices of a structured array and keep the field names?  For instance, I've got dtype=[('x','f4'),('y','f4'), ('z','f4')] and I want to get just the x y slices into a new array with

Re: [Numpy-discussion] Slices of structured arrays

2009-06-01 Thread Robert Ferrell
On Jun 1, 2009, at 4:41 PM, Robert Kern wrote: On Mon, Jun 1, 2009 at 17:32, Robert Ferrell ferr...@diablotech.com wrote: Is there a way to get slices of a structured array and keep the field names? For instance, I've got dtype=[('x','f4'),('y','f4'), ('z','f4')] and I want to get just

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 15:31, josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac ais...@american.edu wrote: On 6/1/2009 3:38 PM josef.p...@gmail.com apparently wrote: Here's a good one: np.isnan([]).all() True np.isnan([]).any() False   all([]) True   any([])

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Keith Goodman
On Mon, Jun 1, 2009 at 4:50 PM, josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:43 PM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 15:31,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 4:06 PM, Alan G

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 7:58 PM, Keith Goodman kwgood...@gmail.com wrote: On Mon, Jun 1, 2009 at 4:50 PM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:43 PM,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 18:50, josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:43 PM,  josef.p...@gmail.com wrote: is np.size the right check for non-empty array, including subtypes? Yes. i.e. if y.size and mask.all():        return np.nan or more explicit if y.size 0 and

Re: [Numpy-discussion] numpy.nansum() behavior in 1.3.0

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 20:09, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 6:30 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 18:50,  josef.p...@gmail.com wrote: On Mon, Jun 1, 2009 at 7:43 PM,  josef.p...@gmail.com wrote: is np.size the

[Numpy-discussion] how can one catch a multiarray.error

2009-06-01 Thread josef . pktd
how do we catch a multiarray.error in a try except clause? e.g. np.argmin([]) Traceback (most recent call last): File pyshell#147, line 1, in module np.argmin([]) File C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py, line 631, in argmin return _wrapit(a, 'argmin',

Re: [Numpy-discussion] how can one catch a multiarray.error

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 21:37, josef.p...@gmail.com wrote: how do we catch a multiarray.error in a try except clause? e.g. np.argmin([]) Traceback (most recent call last):  File pyshell#147, line 1, in module    np.argmin([])  File

Re: [Numpy-discussion] how can one catch a multiarray.error

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 8:37 PM, josef.p...@gmail.com wrote: how do we catch a multiarray.error in a try except clause? e.g. np.argmin([]) Traceback (most recent call last): File pyshell#147, line 1, in module np.argmin([]) File

Re: [Numpy-discussion] how can one catch a multiarray.error

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 8:43 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 21:37, josef.p...@gmail.com wrote: how do we catch a multiarray.error in a try except clause? e.g. np.argmin([]) Traceback (most recent call last): File pyshell#147, line 1, in module

Re: [Numpy-discussion] how can one catch a multiarray.error

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 11:27 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 8:43 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at 21:37,  josef.p...@gmail.com wrote: how do we catch a multiarray.error in a try except clause? e.g.

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread David Cournapeau
Charles R Harris wrote: On Mon, Jun 1, 2009 at 11:48 AM, Charles R Harris charlesr.har...@gmail.com mailto:charlesr.har...@gmail.com wrote: On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern robert.k...@gmail.com mailto:robert.k...@gmail.com wrote: On Mon, Jun 1, 2009 at

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 22:33, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Charles R Harris wrote: On Mon, Jun 1, 2009 at 11:48 AM, Charles R Harris charlesr.har...@gmail.com mailto:charlesr.har...@gmail.com wrote:     On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern    

[Numpy-discussion] numpy.int32, type inheritance and tp_flags

2009-06-01 Thread David Cournapeau
Hi, I have a question related to #1121 (http://projects.scipy.org/numpy/ticket/1121). With python 2.6, PyInt_Check(a) if a is an instance of numpy.int32 does not work anymore. It think this is related to the python issue 2263 (http://bugs.python.org/issue2263), where the tp_flags has been

Re: [Numpy-discussion] numpy.int32, type inheritance and tp_flags

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Hi, I have a question related to #1121 (http://projects.scipy.org/numpy/ticket/1121). With python 2.6, PyInt_Check(a) if a is an instance of numpy.int32 does not work anymore. It think this is related