Test whether any elements of an array evaluate to True along an axis.
Parameters: | a : array_like
axis : int, optional
out : ndarray, optional
|
---|---|
Returns: | out : ndarray
|
See also
Notes
Since NaN is not equal to zero, NaN evaluates to True.
Examples
>>> np.any([[True, False], [True, True]])
True
>>> np.any([[True, False], [False, False]], axis=0)
array([ True, False], dtype=bool)
>>> np.any([-1, 0, 5])
True
>>> np.any(np.nan)
True