From 6aed49135b26fe23620b15cab6c3b99c56545867 Mon Sep 17 00:00:00 2001 From: Brandon Carter Date: Mon, 21 Aug 2017 16:24:24 -0700 Subject: update example in np.nonzero docstring --- numpy/core/fromnumeric.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'numpy/core/fromnumeric.py') 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 -- cgit v1.2.1