diff options
author | pierregm <pierregm@localhost> | 2008-12-02 02:40:22 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2008-12-02 02:40:22 +0000 |
commit | 2dd04cee57d2d4a29bf4c0c8e4024494d3e499f1 (patch) | |
tree | 76a92e920ff17bd6a0a4faf7f026600d52a17257 /numpy/ma/core.py | |
parent | 77f95a1398ddad2d031aaf8e4db344ffc93d1d73 (diff) | |
download | numpy-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.py | 12 |
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 |