summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2008-12-02 02:40:22 +0000
committerpierregm <pierregm@localhost>2008-12-02 02:40:22 +0000
commit2dd04cee57d2d4a29bf4c0c8e4024494d3e499f1 (patch)
tree76a92e920ff17bd6a0a4faf7f026600d52a17257 /numpy/ma/core.py
parent77f95a1398ddad2d031aaf8e4db344ffc93d1d73 (diff)
downloadnumpy-2dd04cee57d2d4a29bf4c0c8e4024494d3e499f1.tar.gz
* Fixed MaskedArray for nested dtype w/ input mask
* Fixed masked_all for nested dtype * Fixed masked_all_like for nested dtype
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index c8bc425f4..a8922a597 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -1488,8 +1488,16 @@ class MaskedArray(ndarray):
_data._sharedmask = not copy
else:
if names_:
- for n in names_:
- _data._mask[n] |= mask[n]
+ def _recursive_or(a, b):
+ "do a|=b on each field of a, recursively"
+ for name in a.dtype.names:
+ (af, bf) = (a[name], b[name])
+ if af.dtype.names:
+ _recursive_or(af, bf)
+ else:
+ af |= bf
+ return
+ _recursive_or(_data._mask, mask)
else:
_data._mask = np.logical_or(mask, _data._mask)
_data._sharedmask = False