diff options
author | pierregm <pierregm@localhost> | 2008-09-28 17:27:37 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2008-09-28 17:27:37 +0000 |
commit | 855ede0f17fb4d12448b0d1ec60b8431f7100447 (patch) | |
tree | 4804d86c36899d23951cabd80d6680cf8b52cfc6 /numpy/ma/core.py | |
parent | 55f467b6e64949eef5c614501df34a5e9af70b38 (diff) | |
download | numpy-855ede0f17fb4d12448b0d1ec60b8431f7100447.tar.gz |
core:
* added __rmul and __radd__
* fixed concatenate for flexible-dtype
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) |