summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 118f8f6df..6de5e7ee4 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -1824,7 +1824,11 @@ class MaskedArray(ndarray):
res = self._data.astype("|O8")
res[m] = f
else:
- res = self._data.astype([(n,'|O8') for n in names])
+ rdtype = [list(_) for _ in self.dtype.descr]
+ for r in rdtype:
+ r[1] = '|O8'
+ rdtype = [tuple(_) for _ in rdtype]
+ res = self._data.astype(rdtype)
for field in names:
np.putmask(res[field], m[field], f)
else: