diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-01-13 08:07:14 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-01-13 08:13:51 +0100 |
commit | b82230fdb438ba368e18ad8d3c55cb4779ab2acf (patch) | |
tree | fff72c9086dfd33c3c86c7999dd439bd54d13e4b /numpy/ma/extras.py | |
parent | b1f8bcf451ef75344439d56c9953f6652af899d7 (diff) | |
download | numpy-b82230fdb438ba368e18ad8d3c55cb4779ab2acf.tar.gz |
BUG: fix ma.median used on ndarrays
ndarrays have a data attribute pointing to the data buffer which leads
to the median working on a byte view instead of the actual type.
closes gh-5424
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 1849df72b..dcf7f39f9 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -41,7 +41,7 @@ import warnings from . import core as ma from .core import MaskedArray, MAError, add, array, asarray, concatenate, count, \ filled, getmask, getmaskarray, make_mask_descr, masked, masked_array, \ - mask_or, nomask, ones, sort, zeros + mask_or, nomask, ones, sort, zeros, getdata #from core import * import numpy as np @@ -671,7 +671,7 @@ def median(a, axis=None, out=None, overwrite_input=False): """ if not hasattr(a, 'mask') or np.count_nonzero(a.mask) == 0: - return masked_array(np.median(getattr(a, 'data', a), axis=axis, + return masked_array(np.median(getdata(a, subok=True), axis=axis, out=out, overwrite_input=overwrite_input), copy=False) if overwrite_input: if axis is None: |