summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2010-02-08 07:35:34 +0000
committerpierregm <pierregm@localhost>2010-02-08 07:35:34 +0000
commit69c2a3bff7c07fd88e35b02bf1cbfa5f48abd975 (patch)
treef13519e2ecbf0989aebeb646c0731e2c8f019f93 /numpy/ma/core.py
parent53f1ee985c07924eec61133f8c6b8f27c481ac84 (diff)
downloadnumpy-69c2a3bff7c07fd88e35b02bf1cbfa5f48abd975.tar.gz
* allow fill_value to be np.void
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index f4aa16d0c..26388ffb5 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -394,7 +394,7 @@ def _check_fill_value(fill_value, ndtype):
fill_value = default_fill_value(ndtype)
elif fields:
fdtype = [(_[0], _[1]) for _ in ndtype.descr]
- if isinstance(fill_value, ndarray):
+ if isinstance(fill_value, (ndarray, np.void)):
try:
fill_value = np.array(fill_value, copy=False, dtype=fdtype)
except ValueError:
@@ -2733,9 +2733,6 @@ class MaskedArray(ndarray):
# But don't run the check unless we have something to check....
if fill_value is not None:
_data._fill_value = _check_fill_value(fill_value, _data.dtype)
- elif names_:
- # Named fields: make sure _fill_value is initialized
- _data._fill_value = _check_fill_value(None, _data.dtype)
# Process extra options ..
if hard_mask is None:
_data._hardmask = getattr(data, '_hardmask', False)