diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-02-09 15:47:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 15:47:14 -0600 |
commit | 3f3e6045d594e28cd1953de9353b9f7cc103386f (patch) | |
tree | fd07a9cf79908d78b8f195bcb4b1ab5495889fbf /numpy/lib/utils.py | |
parent | 2bdecde364f133ce94b7f9271a6d34a8fb5cae86 (diff) | |
parent | 4152443b1d268951401e0be1351eccbddd572e97 (diff) | |
download | numpy-3f3e6045d594e28cd1953de9353b9f7cc103386f.tar.gz |
Merge pull request #18324 from anntzer/fm
MAINT: Avoid moveaxis overhead in median.
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index f7e176cf3..8f5c6eea3 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -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) |