[Numpy-discussion] Type conversion weirdness in numpy-1.0.2.win32-py2.4 binary

2007-05-07 Thread Martin Spacek
In linux and win32 (numpy 1.0.1 release compiled from source, and 1.0.3dev3726 respectively), I get the following normal behaviour: >>> import numpy as np >>> np.array([1.0, 2.0, 3.0, 4.0]) array([ 1., 2., 3., 4.]) >>> np.int32(np.array([1.0, 2.0, 3.0, 4.0])) array([ 1, 2, 3, 4]) But on thr

Re: [Numpy-discussion] Should numpy.allclose return True for arrays of different shape ?

2007-05-07 Thread Robert Kern
David Cournapeau wrote: > Robert Kern wrote: >> David Cournapeau wrote: >>> Hi, >>> >>> I wanted to know if the following behaviour is a bug or intended >>> behaviour: >>> >>> """ >>> import numpy as N >>> N.allclose(N.array([[1., 1.]]), N.array([1.])) >>> """ >>> >>> eg should allclose retu

Re: [Numpy-discussion] Should numpy.allclose return True for arrays of different shape ?

2007-05-07 Thread David Cournapeau
Robert Kern wrote: > David Cournapeau wrote: >> Hi, >> >> I wanted to know if the following behaviour is a bug or intended >> behaviour: >> >> """ >> import numpy as N >> N.allclose(N.array([[1., 1.]]), N.array([1.])) >> """ >> >> eg should allclose return True if arrays have different shape

Re: [Numpy-discussion] Searching object arrays

2007-05-07 Thread Martin Spacek
Great, thanks Tim! Martin Timothy Hochberg wrote: > > Using np.equals instead of == seems to work: > > >>> i = np.array([0,1,2,None,3,4,None]) > >>> i > array([0, 1, 2, None, 3, 4, None], dtype=object) > >>> np.where(i == None) > () > >>> i == None > False > >>> np.where(np.equal(i, None))

Re: [Numpy-discussion] Searching object arrays

2007-05-07 Thread Timothy Hochberg
On 5/7/07, Martin Spacek <[EMAIL PROTECTED]> wrote: I want to find the indices of all the None objects in an object array: >> import numpy as np >> i = np.array([0, 1, 2, None, 3, 4, None]) >> np.where(i == None) () Using == doesn't work the same way on object arrays as it does on, say, an arr

[Numpy-discussion] Searching object arrays

2007-05-07 Thread Martin Spacek
I want to find the indices of all the None objects in an object array: >> import numpy as np >> i = np.array([0, 1, 2, None, 3, 4, None]) >> np.where(i == None) () Using == doesn't work the same way on object arrays as it does on, say, an array of int32. Any suggestions? Do I have to use a lo

Re: [Numpy-discussion] Should numpy.allclose return True for arrays of different shape ?

2007-05-07 Thread Robert Kern
David Cournapeau wrote: > Hi, > > I wanted to know if the following behaviour is a bug or intended > behaviour: > > """ > import numpy as N > N.allclose(N.array([[1., 1.]]), N.array([1.])) > """ > > eg should allclose return True if arrays have different shape ? If they are broadcastable

Re: [Numpy-discussion] matlab vs. python question

2007-05-07 Thread Christopher Barker
Bill Baxter wrote: > Of course even better would be if ipython were in a GUI, and > docstrings could just be proactively prefectched and displayed in > another pane while I type, or argument lists could be popped up like > in PyCrust. I think someone was working on iPython-PyCrust integration at s

[Numpy-discussion] Should numpy.allclose return True for arrays of different shape ?

2007-05-07 Thread David Cournapeau
Hi, I wanted to know if the following behaviour is a bug or intended behaviour: """ import numpy as N N.allclose(N.array([[1., 1.]]), N.array([1.])) """ eg should allclose return True if arrays have different shape ? cheers, David ___

Re: [Numpy-discussion] howto check arrays for equal (numpy 1.0b, array_equal is absent)? & best way to copy?

2007-05-07 Thread Bill Baxter
On 5/7/07, dmitrey <[EMAIL PROTECTED]> wrote: > hi all, > I have some troubles with Python2.5+matplotlib, so now I'm using > Python2.4.3. I failed to compile both numpy1.0.1 and 1.0.2 > (Mandrake2007) so currently I'm using 1.0b. > Howto check if numpy.array instances x and y are equal? (i.e. all >

[Numpy-discussion] howto check arrays for equal (numpy 1.0b, array_equal is absent)? & best way to copy?

2007-05-07 Thread dmitrey
hi all, I have some troubles with Python2.5+matplotlib, so now I'm using Python2.4.3. I failed to compile both numpy1.0.1 and 1.0.2 (Mandrake2007) so currently I'm using 1.0b. Howto check if numpy.array instances x and y are equal? (i.e. all elements are same) Please answer one more question -