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

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 11:58 PM, David Cournapeau < da...@ar.media.kyoto-u.ac.jp> wrote: > Charles R Harris wrote: > > > > > > On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau > > mailto:da...@ar.media.kyoto-u.ac.jp>> > > wrote: > > > > Hi, > > > >I have a question related to #1121 >

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

2009-06-01 Thread David Cournapeau
Charles R Harris wrote: > > > On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau > mailto: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 o

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

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 11:50 PM, David Cournapeau < da...@ar.media.kyoto-u.ac.jp> wrote: > Charles R Harris wrote: > > > > > > On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau > > mailto:da...@ar.media.kyoto-u.ac.jp>> > > wrote: > > > > Hi, > > > >I have a question related to #1121 >

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 r

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

2009-06-01 Thread David Cournapeau
Charles R Harris wrote: > > > On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau > mailto: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 o

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 r

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

[Numpy-discussion] Tutorial topics for SciPy'09 Conference

2009-06-01 Thread Fernando Perez
Hi all, The time for the Scipy'09 conference is rapidly approaching, and we would like to both announce the plan for tutorials and solicit feedback from everyone on topics of interest. Broadly speaking, the plan is something along the lines of what we had last year: one continuous 2-day tutorial

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread David Cournapeau
Robert Kern wrote: >> This does not solve the C function problem (PyArray_Correlate). The easy >> solution would be to keep the current C version, deal with the problem >> in python for acorrelate for the time being, and replace the old C >> function with the 'correct' one once we remove the deprec

Re: [Numpy-discussion] Problem with correlate

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

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 > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern > mailto:robert.k...@gmail.com>> wrote: > > On Mon, Jun 1, 2009 at 00:05, David Cournapeau >

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 wrote: > > > On Mon, Jun 1, 2009 at 8:43 PM, Robert Kern wrote: >> >> On Mon, Jun 1, 2009 at 21:37,   wrote: >> > how do we catch a multiarray.error in a try except clause? >> > >> > e.g. >> np.argmin([]) >> > Traceback (most recent call last

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 wrote: > On Mon, Jun 1, 2009 at 21:37, wrote: > > how do we catch a multiarray.error in a try except clause? > > > > e.g. > np.argmin([]) > > Traceback (most recent call last): > > File "", line 1, in > >np.argmin([]) > > File "C:\Programs

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, wrote: > how do we catch a multiarray.error in a try except clause? > > e.g. > >>> np.argmin([]) > Traceback (most recent call last): > File "", line 1, in >np.argmin([]) > File "C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py", > line 631,

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

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 21:37, wrote: > how do we catch a multiarray.error in a try except clause? > > e.g. np.argmin([]) > Traceback (most recent call last): >  File "", line 1, in >    np.argmin([]) >  File "C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py", > line 631, in

[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 "", line 1, in np.argmin([]) File "C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py", line 631, in argmin return _wrapit(a, 'argmin', axis) File

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

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 9:15 PM, Robert Kern wrote: > On Mon, Jun 1, 2009 at 20:09, Charles R Harris > wrote: >> >> On Mon, Jun 1, 2009 at 6:30 PM, Robert Kern wrote: >>> >>> On Mon, Jun 1, 2009 at 18:50,   wrote: >>> > On Mon, Jun 1, 2009 at 7:43 PM,   wrote: >>> >>> >> is np.size the right chec

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 wrote: > > On Mon, Jun 1, 2009 at 6:30 PM, Robert Kern wrote: >> >> On Mon, Jun 1, 2009 at 18:50,   wrote: >> > On Mon, Jun 1, 2009 at 7:43 PM,   wrote: >> >> >> is np.size the right check for non-empty array, including subtypes? >> >> Yes. >> >> >>

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

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 6:30 PM, Robert Kern wrote: > On Mon, Jun 1, 2009 at 18:50, wrote: > > On Mon, Jun 1, 2009 at 7:43 PM, 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 >

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

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 18:50, wrote: > On Mon, Jun 1, 2009 at 7:43 PM,   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 mask.all(): >>        return n

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 wrote: > On Mon, Jun 1, 2009 at 4:50 PM,   wrote: >> On Mon, Jun 1, 2009 at 7:43 PM,   wrote: >>> On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern wrote: On Mon, Jun 1, 2009 at 15:31,   wrote: > On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac wrote:

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, wrote: > On Mon, Jun 1, 2009 at 7:43 PM,   wrote: >> On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern wrote: >>> On Mon, Jun 1, 2009 at 15:31,   wrote: On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac wrote: > On 6/1/2009 3:38 PM josef.p...@gmail.com apparently w

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

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 7:43 PM, wrote: > On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern wrote: >> On Mon, Jun 1, 2009 at 15:31,   wrote: >>> On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac wrote: On 6/1/2009 3:38 PM josef.p...@gmail.com apparently wrote: > Here's a good one: > n

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

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 7:30 PM, Robert Kern wrote: > On Mon, Jun 1, 2009 at 15:31,   wrote: >> On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac 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([]).

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

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 15:31, wrote: > On Mon, Jun 1, 2009 at 4:06 PM, Alan G Isaac 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] 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 > 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

Re: [Numpy-discussion] Slices of structured arrays

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 17:32, Robert Ferrell 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 dtype=[('x','f4'),('y','f4')]. >

[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] 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 wrote: > yeah, I came back here ju

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

2009-06-01 Thread Chris Colbert
yeah, I came back here just now to call myself an idiot, but I'm too late :) Chris On Mon, Jun 1, 2009 at 5:37 PM, Robert Kern wrote: > On Mon, Jun 1, 2009 at 16:35, Chris Colbert wrote: > > thanks Robert, > > > > the directory indeed wasnt in the $PATH variable. > > No, not the environment va

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 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 made terrible by o

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 wrote: > On Mon, Jun 1, 2009 at 15:37, Chris Colbert wrote: > > On 64-bit ubuntu 9.04 and Python 2.6, I built numpy from source against > > atlas and lapack (everything

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 15:37, Chris Colbert 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 module, even thou

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 wrote: > On Mon, Jun 1, 2009 at 4:37 PM, Chris Colbert wrote: > > On 64-bit ubuntu 9.04 and Python 2.6, I built numpy from source against > > atlas and

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 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 module, even th

[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] 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 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) >>> (

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

2009-06-01 Thread Alan G Isaac
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 Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussio

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 wrote: > On Mon, Jun 1, 2009 at 11:34 AM,   wrote: >> On Mon, Jun 1, 2009 at 2:26 PM, Keith Goodman wrote: >>> On Mon, Jun 1, 2009 at 11:16 AM,   wrote: On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman wrote: > On Mon, Jun 1, 2009 at 9:55 AM, M

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 13:44, Charles R Harris wrote: > > > On Mon, Jun 1, 2009 at 11:48 AM, Charles R Harris > wrote: >> >> >> On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern >> wrote: >>> >>> On Mon, Jun 1, 2009 at 00:05, David Cournapeau >>> wrote: >>> >>> > I think we should just fix it to use

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 Nabble.c

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

2009-06-01 Thread Keith Goodman
On Mon, Jun 1, 2009 at 11:34 AM, wrote: > On Mon, Jun 1, 2009 at 2:26 PM, Keith Goodman wrote: >> On Mon, Jun 1, 2009 at 11:16 AM,   wrote: >>> On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman wrote: On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne wrote: > A question (and possibly a bug):

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 wrote: > > > On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern wrote: > >> On Mon, Jun 1, 2009 at 00:05, David Cournapeau >> wrote: >> >> > I think we should just fix it to use conjugate - I will do this in the >> > branch, and I will integrate it in

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 wrote: > On Mon, Jun 1, 2009 at 11:16 AM,   wrote: >> On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman wrote: >>> On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne wrote: A question (and possibly a bug): What should be returned when I do: >>

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, wrote: > On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman wrote: >> On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne 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 g

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 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 > functions comp

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

2009-06-01 Thread josef . pktd
On Mon, Jun 1, 2009 at 1:43 PM, Keith Goodman wrote: > On Mon, Jun 1, 2009 at 9:55 AM, Michael Hearne 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. >> H

Re: [Numpy-discussion] Problem with correlate

2009-06-01 Thread Charles R Harris
On Mon, Jun 1, 2009 at 10:35 AM, Robert Kern wrote: > On Mon, Jun 1, 2009 at 00:05, David Cournapeau > 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 ch

Re: [Numpy-discussion] setmember1d_nu

2009-06-01 Thread Neil Crighton
Robert Cimrman 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 > >

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 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 which I

[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] Problem with correlate

2009-06-01 Thread Robert Kern
On Mon, Jun 1, 2009 at 00:05, David Cournapeau 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 this, > though, It breaks ev

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