numpy.
flatnonzero
(a)[source]Return indices that are non-zero in the flattened version of a.
This is equivalent to a.ravel().nonzero()[0].
Parameters: | a : ndarray
|
---|---|
Returns: | res : ndarray
|
See also
Examples
Use the indices of the non-zero elements as an index array to extract these elements:
联系客服