diff options
| author | Sebastian Berg <sebastianb@nvidia.com> | 2022-12-06 09:55:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-06 09:55:38 +0100 |
| commit | 297c66131f2a32ebb7dfb0aeb9d88d917a791430 (patch) | |
| tree | 99d543dfd704cc6f62d7f8bd9217d82711efa2f6 /numpy/ma/extras.py | |
| parent | e877ba95bb3e22238353df0d654ef4d425c42f42 (diff) | |
| parent | 91432a36a3611c2374ea9e2d45592f0ac5e71adb (diff) | |
| download | numpy-297c66131f2a32ebb7dfb0aeb9d88d917a791430.tar.gz | |
Merge pull request #22721 from byrdie/bugfix/median-keepdims-out
BUG: `keepdims=True` is ignored if `out` is not `None` in `numpy.median`.
Diffstat (limited to 'numpy/ma/extras.py')
| -rw-r--r-- | numpy/ma/extras.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 4e7f8e85e..41bce0f22 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -732,12 +732,8 @@ def median(a, axis=None, out=None, overwrite_input=False, keepdims=False): else: return m - r, k = _ureduce(a, func=_median, axis=axis, out=out, + return _ureduce(a, func=_median, keepdims=keepdims, axis=axis, out=out, overwrite_input=overwrite_input) - if keepdims: - return r.reshape(k) - else: - return r def _median(a, axis=None, out=None, overwrite_input=False): |
