diff options
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 036d6312c..491c2c605 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2837,6 +2837,12 @@ class MaskedArray(ndarray): _data = ndarray.view(_data, type(data)) else: _data = ndarray.view(_data, cls) + + # Handle the case where data is not a subclass of ndarray, but + # still has the _mask attribute like MaskedArrays + if hasattr(data, '_mask') and not isinstance(data, ndarray): + _data._mask = data._mask + # FIXME: should we set `_data._sharedmask = True`? # Process mask. # Type of the mask mdtype = make_mask_descr(_data.dtype) |