diff options
author | tteichmann <44259103+tteichmann@users.noreply.github.com> | 2018-10-19 17:38:44 +0200 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-10-19 08:38:44 -0700 |
commit | 7e0d3fe31ed6a31ff08fb1fc0c9e6c0e1f6a8568 (patch) | |
tree | 2b6e829c9a79dec516b4c39f28f09d85749e3100 /numpy/core/fromnumeric.py | |
parent | f0ce97ed8e98687a48b42a1f5f1f7ee84055fbd6 (diff) | |
download | numpy-7e0d3fe31ed6a31ff08fb1fc0c9e6c0e1f6a8568.tar.gz |
DOC: Clarify the examples for argmax and argmin (#12211)
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index b189dae5f..2fdbf3e23 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1071,10 +1071,10 @@ def argmax(a, axis=None, out=None): Examples -------- - >>> a = np.arange(6).reshape(2,3) + >>> a = np.arange(6).reshape(2,3) + 10 >>> a - array([[0, 1, 2], - [3, 4, 5]]) + array([[10, 11, 12], + [13, 14, 15]]) >>> np.argmax(a) 5 >>> np.argmax(a, axis=0) @@ -1088,7 +1088,7 @@ def argmax(a, axis=None, out=None): >>> ind (1, 2) >>> a[ind] - 5 + 15 >>> b = np.arange(6) >>> b[1] = 5 @@ -1140,10 +1140,10 @@ def argmin(a, axis=None, out=None): Examples -------- - >>> a = np.arange(6).reshape(2,3) + >>> a = np.arange(6).reshape(2,3) + 10 >>> a - array([[0, 1, 2], - [3, 4, 5]]) + array([[10, 11, 12], + [13, 14, 15]]) >>> np.argmin(a) 0 >>> np.argmin(a, axis=0) @@ -1157,12 +1157,12 @@ def argmin(a, axis=None, out=None): >>> ind (0, 0) >>> a[ind] - 0 + 10 - >>> b = np.arange(6) - >>> b[4] = 0 + >>> b = np.arange(6) + 10 + >>> b[4] = 10 >>> b - array([0, 1, 2, 3, 0, 5]) + array([10, 11, 12, 13, 10, 15]) >>> np.argmin(b) # Only the first occurrence is returned. 0 |