[Numpy-discussion] Re: where() has started returning a tuple!?
Andrew Jaffe
a.h.jaffe at gmail.com
Mon Apr 17 00:53:04 CDT 2006
Aha, missed that thread (and the docstring -- my bad). And actually I
misunderstood the effect of the change, anyway: a[where(a>0)] is still
fine, it's just other activities like iterating over where(a>0) that is
no longer possible in the same way.
Thanks for the pointer!
Andrew
Perry Greenfield wrote:
> see:
>
> http://sourceforge.net/mailarchive/forum.php?thread_id=10165581&forum_id=489
> 0
>
>> -----Original Message-----
>> From: numpy-discussion-admin at lists.sourceforge.net
>> [mailto:numpy-discussion-admin at lists.sourceforge.net]On Behalf Of Andrew
>> Jaffe
>> Sent: Sunday, April 16, 2006 6:17 PM
>> To: numpy-discussion at lists.sourceforge.net
>> Subject: [Numpy-discussion] where() has started returning a tuple!?
>>
>>
>> I think the following behavior is (only recently) wrong:
>>
>> In [7]: numpy.__version__
>> Out[7]: '0.9.7.2360'
>>
>> In [8]: numpy.nonzero([True, False, True])
>> Out[8]: array([0, 2])
>>
>> In [9]: numpy.where([True, False, True])
>> Out[9]: (array([0, 2]),)
>>
>> Note the tuple output to where(), which should be the same as nonzero.
>>
>> Andrew
>>
More information about the Numpy-discussion
mailing list