summaryrefslogtreecommitdiff
path: root/numpy/core/ma.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r--numpy/core/ma.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py
index df71ee825..063baa455 100644
--- a/numpy/core/ma.py
+++ b/numpy/core/ma.py
@@ -526,6 +526,7 @@ class MaskedArray (object):
such as when printing and in method/function filled().
The fill_value is not used for computation within this module.
"""
+ __array_priority__ = 10.1
def __init__(self, data, dtype=None, copy=True, fortran=False,
mask=None, fill_value=None):
"""array(data, dtype=None, copy=True, fortran=False, mask=None, fill_value=None)
@@ -607,6 +608,12 @@ class MaskedArray (object):
else:
return self._data
+ def __array_wrap__ (self, array):
+ """Special hook for ufuncs. Converts to Masked array with
+ the same mask as self."""
+ return MaskedArray(array, copy=False, mask=self._mask,
+ fill_value = self._fill_value)
+
def _get_shape(self):
"Return the current shape."
return self._data.shape