summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorHenry Schreiner <HenrySchreinerIII@gmail.com>2021-06-29 09:32:56 -0400
committerHenry Schreiner <henryschreineriii@gmail.com>2021-06-29 09:38:18 -0400
commitad6d423acf45c0b06b478e898a6ddaf358e0c0a3 (patch)
treed5d1b10f745d38bac0c293e20ccf687382ef6b4a /numpy/core/fromnumeric.py
parent164682330d70ffe84e706a67955435b76e1cf19d (diff)
downloadnumpy-ad6d423acf45c0b06b478e898a6ddaf358e0c0a3.tar.gz
DOC: change more np.min/np.max to np.amin/np.amax
A few places were missed, so the docs switched back to `np.min`/`np.max` partway through the examples. These are not statically typed anymore since 1.21.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 820d6831f..ee93da901 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1183,11 +1183,11 @@ def argmax(a, axis=None, out=None):
>>> x = np.array([[4,2,3], [1,0,3]])
>>> index_array = np.argmax(x, axis=-1)
- >>> # Same as np.max(x, axis=-1, keepdims=True)
+ >>> # Same as np.amax(x, axis=-1, keepdims=True)
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1)
array([[4],
[3]])
- >>> # Same as np.max(x, axis=-1)
+ >>> # Same as np.amax(x, axis=-1)
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1).squeeze(axis=-1)
array([4, 3])
@@ -1264,11 +1264,11 @@ def argmin(a, axis=None, out=None):
>>> x = np.array([[4,2,3], [1,0,3]])
>>> index_array = np.argmin(x, axis=-1)
- >>> # Same as np.min(x, axis=-1, keepdims=True)
+ >>> # Same as np.amin(x, axis=-1, keepdims=True)
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1)
array([[2],
[0]])
- >>> # Same as np.max(x, axis=-1)
+ >>> # Same as np.amax(x, axis=-1)
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1).squeeze(axis=-1)
array([2, 0])
@@ -2740,14 +2740,14 @@ def amax(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
You can use an initial value to compute the maximum of an empty slice, or
to initialize it to a different value:
- >>> np.max([[-50], [10]], axis=-1, initial=0)
+ >>> np.amax([[-50], [10]], axis=-1, initial=0)
array([ 0, 10])
Notice that the initial value is used as one of the elements for which the
maximum is determined, unlike for the default argument Python's max
function, which is only used for empty iterables.
- >>> np.max([5], initial=6)
+ >>> np.amax([5], initial=6)
6
>>> max([5], default=6)
5
@@ -2863,7 +2863,7 @@ def amin(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
>>> np.nanmin(b)
0.0
- >>> np.min([[-50], [10]], axis=-1, initial=0)
+ >>> np.amin([[-50], [10]], axis=-1, initial=0)
array([-50, 0])
Notice that the initial value is used as one of the elements for which the
@@ -2872,7 +2872,7 @@ def amin(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
Notice that this isn't the same as Python's ``default`` argument.
- >>> np.min([6], initial=5)
+ >>> np.amin([6], initial=5)
5
>>> min([6], default=5)
6