summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
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)