summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 58f8696d2..973ba7b3a 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1509,13 +1509,12 @@ def nonzero(a):
Examples
--------
- >>> x = np.eye(3)
+ >>> x = np.array([[1,0,0], [0,2,0], [1,1,0]])
>>> x
- array([[ 1., 0., 0.],
- [ 0., 1., 0.],
- [ 0., 0., 1.]])
- >>> np.nonzero(x)
- (array([0, 1, 2]), array([0, 1, 2]))
+ array([[1, 0, 0],
+ [0, 2, 0],
+ [1, 1, 0]])
+ >>> (array([0, 1, 2, 2], dtype=int64), array([0, 1, 0, 1], dtype=int64))
>>> x[np.nonzero(x)]
array([ 1., 1., 1.])