First page Back Continue Last page Overview Graphics

numpy.where

If only the condition parameter is given, numpy.where returns the tuple condition.nonzero(), the indices where condition is True.

>>> np.where(a < 10)

(array([0, 3]),)

equivalent to:

>>> (a < 10).nonzero()

(array([0, 3]),)

>>>