diff options
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 90aff6ec8..69fae3512 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -3449,7 +3449,9 @@ class MaskedArray(ndarray): # We could try to force a reshape, but that wouldn't work in some # cases. - return self._mask + # Return a view so that the dtype and shape cannot be changed in place + # This still preserves nomask by identity + return self._mask.view() @mask.setter def mask(self, value): |