diff options
author | Mary <sleeplessinseattle.dev@gmail.com> | 2021-02-17 19:48:22 -0800 |
---|---|---|
committer | Mary <sleeplessinseattle.dev@gmail.com> | 2021-02-17 19:48:22 -0800 |
commit | c902caf7c66bf0657ce8ae0987f72adbaadebd22 (patch) | |
tree | c2b888a8428d5458429d5b9a540cfb427904dda5 /numpy/lib/utils.py | |
parent | dca0d1c928665464b137419f0f530d5a6aac8ebd (diff) | |
parent | 0eb9f54e5e466c8d7a76ae116712b368d045c7e0 (diff) | |
download | numpy-c902caf7c66bf0657ce8ae0987f72adbaadebd22.tar.gz |
Merge branch 'master' of https://github.com/numpy/numpy into iss17845p3a
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 7 |
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) |