summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index d2150919f..ca9f4f474 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3374,8 +3374,11 @@ class MaskedArray(ndarray):
_mask[indx] = mval
elif not self._hardmask:
# Set the data, then the mask
- _data[indx] = dval
- _mask[indx] = mval
+ if isinstance(indx, masked_array):
+ _data[indx.data] = dval
+ else:
+ _data[indx] = dval
+ _mask[indx] = mval
elif hasattr(indx, 'dtype') and (indx.dtype == MaskType):
indx = indx * umath.logical_not(_mask)
_data[indx] = dval