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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 0b5372fa3..a31cbef1b 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -884,6 +884,11 @@ def masked_where(condition, a, copy=True):
"""
cond = make_mask(condition)
a = np.array(a, copy=copy, subok=True)
+
+ (cshape, ashape) = (cond.shape, a.shape)
+ if cshape and cshape != ashape:
+ raise IndexError("Inconsistant shape between the condition and the input"\
+ " (got %s and %s)" % (cshape, ashape))
if hasattr(a, '_mask'):
cond = mask_or(cond, a._mask)
cls = type(a)