[Numpy-discussion] Re: ***[Possible UCE]*** [SciPy-user] Regarding what "where" returns

Robert Cimrman cimrman3 at ntc.zcu.cz
Thu Apr 13 05:24:02 CDT 2006


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 )[0]', right?

r.




More information about the Numpy-discussion mailing list