Find the indices of array elements that are non-zero, grouped by element.
np.argwhere(a)
is the same as np.transpose(np.nonzero(a))
.
The output of argwhere
is not suitable for indexing arrays. For this purpose use nonzero(a)
instead.
>>> x = np.arange(6).reshape(2,3) >>> x array([[0, 1, 2], [3, 4, 5]]) >>> np.argwhere(x>1) array([[0, 2], [1, 0], [1, 1], [1, 2]])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4