diff options
author | seberg <sebastian@sipsolutions.net> | 2017-08-22 10:27:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 10:27:08 +0200 |
commit | 707f33f6a55076bc12e25e736d910545377420e8 (patch) | |
tree | 3cec4810a1eaeea2f7f12aa011dc608f4dfde5ff /numpy/core/fromnumeric.py | |
parent | a0c5f64f4f1a7f6ee80dc9b95aa813df28a87d72 (diff) | |
parent | 6aed49135b26fe23620b15cab6c3b99c56545867 (diff) | |
download | numpy-707f33f6a55076bc12e25e736d910545377420e8.tar.gz |
Merge pull request #9586 from b-carter/fix_nonzero_docstring
DOC: update example in np.nonzero docstring
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 |