summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorFrançois Le Lay <mfworx@gmail.com>2021-02-17 07:24:39 -0500
committerGitHub <noreply@github.com>2021-02-17 07:24:39 -0500
commitdd20b6241590622e847eb4538a224e87eff483f9 (patch)
treece19093db8a459c59819d64e887bb893f5ed11c6 /numpy/lib/utils.py
parent98bf466b42aea9bb804275af6f11d1c7cfdebbad (diff)
parent6f65e1fc25f265ff36bdbfb3aa482f65fd84a684 (diff)
downloadnumpy-dd20b6241590622e847eb4538a224e87eff483f9.tar.gz
Merge branch 'master' into random-standard_t-doc
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index f7e176cf3..24252c834 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -1015,8 +1015,8 @@ def _median_nancheck(data, result, axis, out):
Input data to median function
result : Array or MaskedArray
Result of median function
- axis : {int, sequence of int, None}, optional
- Axis or axes along which the median was computed.
+ axis : int
+ Axis along which the median was computed.
out : ndarray, optional
Output array in which to place the result.
Returns
@@ -1026,8 +1026,7 @@ def _median_nancheck(data, result, axis, out):
"""
if data.size == 0:
return result
- data = np.moveaxis(data, axis, -1)
- n = np.isnan(data[..., -1])
+ n = np.isnan(data.take(-1, axis=axis))
# masked NaN values are ok
if np.ma.isMaskedArray(n):
n = n.filled(False)