summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index b3016da5a..911135505 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -723,7 +723,10 @@ def median(a, axis=None, out=None, overwrite_input=False, keepdims=False):
fill_value=1e+20)
"""
- if not hasattr(a, 'mask'):
+
+ a = np.ma.asarray(a)
+
+ if a.mask is np.ma.nomask:
m = np.median(getdata(a, subok=True), axis=axis,
out=out, overwrite_input=overwrite_input,
keepdims=keepdims)