diff options
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 8eb4b3161..4cb1d83a7 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -1978,14 +1978,26 @@ masked_%(name)s(data = %(data)s, "Add other to self, and return a new masked array." return add(self, other) # + def __radd__(self, other): + "Add other to self, and return a new masked array." + return add(self, other) + # def __sub__(self, other): "Subtract other to self, and return a new masked array." return subtract(self, other) # + def __rsub__(self, other): + "Subtract other to self, and return a new masked array." + return subtract(other, self) + # def __mul__(self, other): "Multiply other by self, and return a new masked array." return multiply(self, other) # + def __rmul__(self, other): + "Multiply other by self, and return a new masked array." + return multiply(self, other) + # def __div__(self, other): "Divide other into self, and return a new masked array." return divide(self, other) @@ -3527,7 +3539,7 @@ def concatenate(arrays, axis=0): # ... all of them are True, and then check for dm.any() # shrink = numpy.logical_or.reduce([getattr(a,'_shrinkmask',True) for a in arrays]) # if shrink and not dm.any(): - if not dm.any(): + if not dm.dtype.fields and not dm.any(): data._mask = nomask else: data._mask = dm.reshape(d.shape) |