[Numpy-discussion] Re: ***[Possible UCE]*** [SciPy-user] Regarding what "where" returns
oliphant.travis at ieee.org
Thu Apr 13 08:43:14 CDT 2006
Robert Cimrman wrote:
> Travis Oliphant wrote:
>> I went ahead and made this change to the code. The nonzero
>> function still behaves as before (and in fact only works for 1-d
>> arrays as it did in Numeric).
>> The where(condition) function works the same as condition.nonzero()
>> and both always return a tuple.
> So, for 1-d arrays, using 'nonzero( condition )' should be faster than
> 'where( condition )', right?
No. since the function just selects off the first element of the tuple
returned by the method...
'condition.nonzero()' may be *slightly* faster than
More information about the Numpy-discussion