diff options
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 338248ce3..10b20c0b1 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1529,14 +1529,15 @@ def nonzero(a): [0, 2, 0], [1, 1, 0]]) >>> np.nonzero(x) - (array([0, 1, 2, 2], dtype=int64), array([0, 1, 0, 1], dtype=int64)) + (array([0, 1, 2, 2]), array([0, 1, 0, 1])) >>> x[np.nonzero(x)] - array([ 1., 1., 1.]) + array([1, 2, 1, 1]) >>> np.transpose(np.nonzero(x)) array([[0, 0], [1, 1], - [2, 2]]) + [2, 0], + [2, 1]) A common use for ``nonzero`` is to find the indices of an array, where a condition is True. Given an array `a`, the condition `a` > 3 is a |