numpy.where()
numpy.where
-
numpy.where(condition[, x, y])
-
Return elements, either from
x
ory
, depending oncondition
.If only
condition
is given, returncondition.nonzero()
.Parameters: condition : array_like, bool
When True, yield
x
, otherwise yieldy
.x, y : array_like, optional
Values from which to choose.
x
andy
need to have the same shape ascondition
.Returns: out