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
see: http://sourceforge.net/mailarchive/forum.php?thread_id=10165581&forum_id=489 0
-----Original Message----- From: numpy-discussion-admin@lists.sourceforge.net [mailto:numpy-discussion-admin@lists.sourceforge.net]On Behalf Of Andrew Jaffe Sent: Sunday, April 16, 2006 6:17 PM To: numpy-discussion@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
------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
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@lists.sourceforge.net [mailto:numpy-discussion-admin@lists.sourceforge.net]On Behalf Of Andrew Jaffe Sent: Sunday, April 16, 2006 6:17 PM To: numpy-discussion@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
participants (2)
-
Andrew Jaffe
-
Perry Greenfield