[Numpy-svn] r5448 - trunk/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Thu Jul 17 19:45:32 CDT 2008


Author: pierregm
Date: 2008-07-17 19:45:23 -0500 (Thu, 17 Jul 2008)
New Revision: 5448

Modified:
   trunk/numpy/ma/core.py
Log:
* fixed a pb with printing flexible ndarrays with subdtypes

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2008-07-17 13:17:45 UTC (rev 5447)
+++ trunk/numpy/ma/core.py	2008-07-18 00:45:23 UTC (rev 5448)
@@ -1824,7 +1824,11 @@
                     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:



More information about the Numpy-svn mailing list