[Numpy-svn] r4762 - branches/maskedarray/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Wed Jan 30 12:32:13 CST 2008


Author: pierregm
Date: 2008-01-30 12:32:11 -0600 (Wed, 30 Jan 2008)
New Revision: 4762

Modified:
   branches/maskedarray/numpy/ma/core.py
Log:
maskedarray.core:
* fixed __getitem__ on records when fill_value is not set
* fixed _extrema_operation.reduce to accept non arrays as arguments (ticket #645)


Modified: branches/maskedarray/numpy/ma/core.py
===================================================================
--- branches/maskedarray/numpy/ma/core.py	2008-01-29 09:32:43 UTC (rev 4761)
+++ branches/maskedarray/numpy/ma/core.py	2008-01-30 18:32:11 UTC (rev 4762)
@@ -1312,7 +1312,7 @@
             # Check the fill_value ....
             if isinstance(indx, basestring):
                 fvindx = list(self.dtype.names).index(indx)
-                dout._fill_value = self._fill_value[fvindx]
+                dout._fill_value = self.fill_value[fvindx]
             # Update the mask if needed
             if m is not nomask:
                 if isinstance(indx, basestring):
@@ -2574,7 +2574,7 @@
     """
     _data = ndarray.__new__(baseclass, baseshape, basetype)
     _mask = ndarray.__new__(ndarray, baseshape, 'b1')
-    return subtype.__new__(subtype, _data, mask=_mask, dtype=basetype, shrink=False)
+    return subtype.__new__(subtype, _data, mask=_mask, dtype=basetype,)
 #MaskedArray.__dump__ = dump
 #MaskedArray.__dumps__ = dumps
 
@@ -2635,6 +2635,7 @@
     #.........
     def reduce(self, target, axis=None):
         "Reduce target along the given axis."
+        target = narray(target, copy=False, subok=True)
         m = getmask(target)
         if axis is not None:
             kargs = { 'axis' : axis }



More information about the Numpy-svn mailing list