summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/multiarray/mapping.c4
-rw-r--r--numpy/ma/core.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index cf294454d..d98f723a7 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -981,8 +981,8 @@ array_ass_boolean_subscript(PyArrayObject *self,
if (size != PyArray_DIMS(v)[0]) {
PyErr_Format(PyExc_TypeError,
"NumPy boolean array indexing assignment "
- "requires an input shape matching the number of True "
- "values in the mask (%d) != (%d)",
+ "cannot assign %d input values to "
+ "the %d output values where the mask is true",
(int)PyArray_DIMS(v)[0], (int)size);
return -1;
}
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index e2e954a97..fdd5d2705 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3040,7 +3040,7 @@ class MaskedArray(ndarray):
mindx = mask_or(_mask[indx], mval, copy=True)
dindx = self._data[indx]
if dindx.size > 1:
- dindx[~mindx] = dval
+ np.copyto(dindx, dval, where=~mindx)
elif mindx is nomask:
dindx = dval
ndarray.__setitem__(_data, indx, dindx)