diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-12-24 13:54:52 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-12-25 15:37:35 +0100 |
commit | 6d52633c90ec6a669dae6a63fe6dac6d1a736cab (patch) | |
tree | a9e443338ceceb61e9a059073f4e7e0b2e93ac1e /numpy/ma/extras.py | |
parent | 44e086d2129c85410a5ea13c79f3ff507a6d6453 (diff) | |
download | numpy-6d52633c90ec6a669dae6a63fe6dac6d1a736cab.tar.gz |
TST: extend ma.median testing and fix inconsistent out return
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 97fb647e9..1774ece30 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -729,6 +729,10 @@ def _median(a, axis=None, out=None, overwrite_input=False): s = mid.sum(out=out) if not odd: s = np.true_divide(s, 2., casting='safe', out=out) + # masked ufuncs do not fullfill `returned is out` (gh-8416) + # fix this to return the same in the nd path + if out is not None: + s = out s = np.lib.utils._median_nancheck(asorted, s, axis, out) else: s = mid.mean(out=out) |