numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
argwhere(a)

Notes

np.argwhere(a) is almost the same as np.transpose(np.nonzero(a)) , but produces a result of the correct shape for a 0D array.

The output of argwhere is not suitable for indexing arrays. For this purpose use nonzero(a) instead.

Parameters

a : array_like

Input data.

Returns

index_array : (N, a.ndim) ndarray

Indices of elements that are non-zero. Indices are grouped by element. This array will have shape (N, a.ndim) where N is the number of non-zero items.

Find the indices of array elements that are non-zero, grouped by element.

See Also

nonzero
where

Examples

>>> 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]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.nonzero dask.array.routines.argwhere

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/numeric.py#571
type: <class 'function'>
Commit: