[Numpy-svn] r8295 - in trunk/numpy/ma: . tests

numpy-svn@scip... numpy-svn@scip...
Thu Mar 18 10:23:08 CDT 2010


Author: pierregm
Date: 2010-03-18 10:23:08 -0500 (Thu, 18 Mar 2010)
New Revision: 8295

Modified:
   trunk/numpy/ma/core.py
   trunk/numpy/ma/tests/test_core.py
   trunk/numpy/ma/tests/test_old_ma.py
Log:
* fixed mvoid.__repr__
* fixed mvoid.__str__ for Python 2.4 (bug #1373)
* add support to 'fill_value' and 'hardmask' in arange/empty/identity/zeros/ones (#1391)
* intercept invalid values in `power` and derived
* added empty_like/ones_like/zeros_like to the numpy.ma namespace
* Allow indices as masked arrays in numpy.ma.take (#1418)
* test_core : temporarily disable warnings when using numpy ufuncs on MaskedArray

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2010-03-17 21:04:15 UTC (rev 8294)
+++ trunk/numpy/ma/core.py	2010-03-18 15:23:08 UTC (rev 8295)
@@ -2535,7 +2535,6 @@
         self.dataiter[index] = getdata(value)
         if self.maskiter is not None:
             self.maskiter[index] = getmaskarray(value)
-#        self.ma1d[index] = value
 
     def next(self):
         """
@@ -2803,10 +2802,6 @@
         return
 
 
-#    def __array_prepare__(self, obj, context=None):
-#        print "DEBUG: __array_prepare__ on obj", obj, " with context:", context
-
-
     def __array_wrap__(self, obj, context=None):
         """
         Special hook for ufuncs.
@@ -2885,7 +2880,7 @@
             except (AttributeError, TypeError):
                 pass
         # Make sure to reset the _fill_value if needed
-        if getattr(output, '_fill_value', None):
+        if getattr(output, '_fill_value', None) is not None:
             output._fill_value = None
         return output
     view.__doc__ = ndarray.view.__doc__
@@ -2952,6 +2947,8 @@
             # A record ................
             if isinstance(dout, np.void):
                 mask = _mask[indx]
+# If we can make mvoid a subclass of np.void, that'd be what we'd need
+#                return mvoid(dout, mask=mask)
                 if flatten_mask(mask).any():
                     dout = mvoid(dout, mask=mask)
                 else:
@@ -2989,17 +2986,16 @@
 #        if getmask(indx) is not nomask:
 #            msg = "Masked arrays must be filled before they can be used as indices!"
 #            raise IndexError, msg
+        _data = ndarray.view(self, ndarray.__getattribute__(self, '_baseclass'))
+        _mask = ndarray.__getattribute__(self, '_mask')
         if isinstance(indx, basestring):
-            ndarray.__setitem__(self._data, indx, value)
-            if self._mask is nomask:
-                self._mask = make_mask_none(self.shape, self.dtype)
-            ndarray.__setitem__(self._mask, indx, getmask(value))
+            ndarray.__setitem__(_data, indx, value)
+            if _mask is nomask:
+                self._mask = _mask = make_mask_none(self.shape, self.dtype)
+            _mask[indx] = getmask(value)
             return
         #........................................
-#        ndgetattr = ndarray.__getattribute__
-        _data = self._data
         _dtype = ndarray.__getattribute__(_data, 'dtype')
-        _mask = ndarray.__getattribute__(self, '_mask')
         nbfields = len(_dtype.names or ())
         #........................................
         if value is masked:
@@ -3773,7 +3769,12 @@
         "Raise self to the power other, in place."
         other_data = getdata(other)
         other_mask = getmask(other)
-        ndarray.__ipow__(self._data, np.where(self._mask, 1, other_data))
+        err_status = np.geterr()
+        try:
+            np.seterr(divide='ignore', invalid='ignore')
+            ndarray.__ipow__(self._data, np.where(self._mask, 1, other_data))
+        finally:
+            np.seterr(**err_status)
         invalid = np.logical_not(np.isfinite(self._data))
         if invalid.any():
             if self._mask is not nomask:
@@ -5212,11 +5213,34 @@
         out -= self.min(axis=axis, fill_value=fill_value)
         return out
 
+    def take(self, indices, axis=None, out=None, mode='raise'):
+        """
+        """
+        (_data, _mask) = (self._data, self._mask)
+        cls = type(self)
+        # Make sure the indices are not masked
+        maskindices = getattr(indices, '_mask', nomask)
+        if maskindices is not nomask:
+            indices = indices.filled(0)
+        # Get the data
+        if out is None:
+            out = _data.take(indices, axis=axis, mode=mode).view(cls)
+        else:
+            np.take(_data, indices, axis=axis, mode=mode, out=out)
+        # Get the mask
+        if isinstance(out, MaskedArray):
+            if _mask is nomask:
+                outmask = maskindices
+            else:
+                outmask = _mask.take(indices, axis=axis, mode=mode)
+                outmask |= maskindices
+            out.__setmask__(outmask)
+        return out
 
+
     # Array methods ---------------------------------------
     copy = _arraymethod('copy')
     diagonal = _arraymethod('diagonal')
-    take = _arraymethod('take')
     transpose = _arraymethod('transpose')
     T = property(fget=lambda self:self.transpose())
     swapaxes = _arraymethod('swapaxes')
@@ -5487,13 +5511,16 @@
         _data[()] = data
         _data = _data.view(self)
         if mask is not nomask:
-            try:
-                # Mask is already a 0D array
-                _data._mask = np.void(mask)
-            except TypeError:
-                # Transform the mask to a void
-                mdtype = make_mask_descr(dtype)
-                _data._mask = np.array(mask, dtype=mdtype)[()]
+            if isinstance(mask, np.void):
+                _data._mask = mask
+            else:
+                try:
+                    # Mask is already a 0D array
+                    _data._mask = np.void(mask)
+                except TypeError:
+                    # Transform the mask to a void
+                    mdtype = make_mask_descr(dtype)
+                    _data._mask = np.array(mask, dtype=mdtype)[()]
         if fill_value is not None:
             _data.fill_value = fill_value
         return _data
@@ -5510,6 +5537,10 @@
             return masked
         return self._data[indx]
 
+    def __setitem__(self, indx, value):
+        self._data[indx] = value
+        self._mask[indx] |= getattr(value, "_mask", False)
+
     def __str__(self):
         m = self._mask
         if (m is nomask):
@@ -5523,7 +5554,7 @@
             p = 'N/A'
         else:
             p = str(p)
-        r = [(str(_), p)[_m] for (_, _m) in zip(r, m)]
+        r = [(str(_), p)[int(_m)] for (_, _m) in zip(r, m)]
         return "(%s)" % ", ".join(r)
 
     def __repr__(self):
@@ -5537,7 +5568,7 @@
         if not p.enabled():
             return self.filled(self.fill_value).__repr__()
         p = str(p)
-        r = [(str(_), p)[_m] for (_, _m) in zip(r, m)]
+        r = [(str(_), p)[int(_m)] for (_, _m) in zip(self._data.tolist(), m)]
         return "(%s)" % ", ".join(r)
 
     def __iter__(self):
@@ -5907,10 +5938,17 @@
 std = _frommethod('std')
 sum = _frommethod('sum')
 swapaxes = _frommethod('swapaxes')
-take = _frommethod('take')
+#take = _frommethod('take')
 trace = _frommethod('trace')
 var = _frommethod('var')
 
+def take(a, indices, axis=None, out=None, mode='raise'):
+    """
+    """
+    a = masked_array(a)
+    return a.take(indices, axis=axis, out=out, mode=mode)
+
+
 #..............................................................................
 def power(a, b, third=None):
     """
@@ -5944,7 +5982,12 @@
     else:
         basetype = MaskedArray
     # Get the result and view it as a (subclass of) MaskedArray
-    result = np.where(m, fa, umath.power(fa, fb)).view(basetype)
+    err_status = np.geterr()
+    try:
+        np.seterr(divide='ignore', invalid='ignore')
+        result = np.where(m, fa, umath.power(fa, fb)).view(basetype)
+    finally:
+        np.seterr(**err_status)
     result._update_from(a)
     # Find where we're in trouble w/ NaNs and Infs
     invalid = np.logical_not(np.isfinite(result.view(ndarray)))
@@ -7047,7 +7090,8 @@
 
 
 class _convert2ma:
-    """Convert functions from numpy to numpy.ma.
+    """
+    Convert functions from numpy to numpy.ma.
 
     Parameters
     ----------
@@ -7056,9 +7100,11 @@
 
     """
     __doc__ = None
-    def __init__(self, funcname):
+    #
+    def __init__(self, funcname, params=None):
         self._func = getattr(np, funcname)
         self.__doc__ = self.getdoc()
+        self._extras = params or {}
     #
     def getdoc(self):
         "Return the doc of the function (from the doc of the method)."
@@ -7072,19 +7118,33 @@
         return doc
     #
     def __call__(self, a, *args, **params):
-        return self._func.__call__(a, *args, **params).view(MaskedArray)
+        # Find the common parameters to the call and the definition
+        _extras = self._extras
+        common_params = set(params).intersection(_extras)
+        # Drop the common parameters from the call
+        for p in common_params:
+            _extras[p] = params.pop(p)
+        # Get the result
+        result = self._func.__call__(a, *args, **params).view(MaskedArray)
+        if "fill_value" in common_params:
+            result.fill_value = _extras.get("fill_value", None)
+        if "hardmask" in common_params:
+            result._hardmask = bool(_extras.get("hard_mask", False))
+        return result
 
-arange = _convert2ma('arange')
+arange = _convert2ma('arange', params=dict(fill_value=None, hardmask=False))
 clip = np.clip
 diff = np.diff
-empty = _convert2ma('empty')
+empty = _convert2ma('empty', params=dict(fill_value=None, hardmask=False))
 empty_like = _convert2ma('empty_like')
 frombuffer = _convert2ma('frombuffer')
 fromfunction = _convert2ma('fromfunction')
-identity = _convert2ma('identity')
+identity = _convert2ma('identity', params=dict(fill_value=None, hardmask=False))
 indices = np.indices
-ones = _convert2ma('ones')
-zeros = _convert2ma('zeros')
+ones = _convert2ma('ones', params=dict(fill_value=None, hardmask=False))
+ones_like = np.ones_like
 squeeze = np.squeeze
+zeros = _convert2ma('zeros', params=dict(fill_value=None, hardmask=False))
+zeros_like = np.zeros_like
 
 ###############################################################################

Modified: trunk/numpy/ma/tests/test_core.py
===================================================================
--- trunk/numpy/ma/tests/test_core.py	2010-03-17 21:04:15 UTC (rev 8294)
+++ trunk/numpy/ma/tests/test_core.py	2010-03-18 15:23:08 UTC (rev 8295)
@@ -196,10 +196,15 @@
 
     def test_fix_invalid(self):
         "Checks fix_invalid."
-        data = masked_array(np.sqrt([-1., 0., 1.]), mask=[0, 0, 1])
-        data_fixed = fix_invalid(data)
-        assert_equal(data_fixed._data, [data.fill_value, 0., 1.])
-        assert_equal(data_fixed._mask, [1., 0., 1.])
+        err_status_ini = np.geterr()
+        try:
+            np.seterr(invalid='ignore')
+            data = masked_array(np.sqrt([-1., 0., 1.]), mask=[0, 0, 1])
+            data_fixed = fix_invalid(data)
+            assert_equal(data_fixed._data, [data.fill_value, 0., 1.])
+            assert_equal(data_fixed._mask, [1., 0., 1.])
+        finally:
+            np.seterr(**err_status_ini)
 
     def test_maskedelement(self):
         "Test of masked element"
@@ -267,7 +272,6 @@
         x2 = masked_values(x1, 3.0)
         assert_equal(x1, x2)
         assert allequal(array([0, 0, 0, 1, 0], MaskType), x2.mask)
-#FIXME: Well, eh, fill_value is now a property        assert_equal(3.0, x2.fill_value())
         assert_equal(3.0, x2.fill_value)
         x1 = array([1, 'hello', 2, 3], object)
         x2 = np.array([1, 'hello', 2, 3], object)
@@ -481,7 +485,6 @@
         assert z[0] is masked
         assert z[1] is not masked
         assert z[2] is masked
-        #
 
 
     def test_oddfeatures_3(self):
@@ -631,6 +634,18 @@
         # w/ mask
         assert_equal(list(a[1]), [masked, 4])
 
+    def test_mvoid_print(self):
+        "Test printing a mvoid"
+        mx = array([(1, 1), (2, 2)], dtype=[('a', int), ('b', int)])
+        assert_equal(str(mx[0]), "(1, 1)")
+        mx['b'][0] = masked
+        ini_display = masked_print_option._display
+        masked_print_option.set_display("-X-")
+        try:
+            assert_equal(str(mx[0]), "(1, -X-)")
+            assert_equal(repr(mx[0]), "(1, -X-)")
+        finally:
+            masked_print_option.set_display(ini_display)
 
 #------------------------------------------------------------------------------
 
@@ -651,7 +666,11 @@
         xf = np.where(m1, 1e+20, x)
         xm.set_fill_value(1e+20)
         self.d = (x, y, a10, m1, m2, xm, ym, z, zm, xf)
+        self.err_status = np.geterr()
+        np.seterr(divide='ignore', invalid='ignore')
 
+    def tearDown(self):
+        np.seterr(**self.err_status)
 
     def test_basic_arithmetic (self):
         "Test of basic arithmetic."
@@ -1041,7 +1060,6 @@
         assert_equal(test, np.mod(xm, ym))
         assert_equal(test.mask, mask_or(mask_or(xm.mask, ym.mask), (ym == 0)))
 
-
     def test_TakeTransposeInnerOuter(self):
         "Test of take, transpose, inner, outer products"
         x = arange(24)
@@ -1083,7 +1101,6 @@
         for funcname in funclist:
             npfunc = getattr(np, funcname)
             xmmeth = getattr(xm, funcname)
-
             # A ndarray as explicit input
             output = np.empty(4, dtype=float)
             output.fill(-9999)
@@ -1148,12 +1165,10 @@
         assert_equal(test.mask, control.mask)
         assert_equal(a.mask, [0, 0, 0, 0, 1])
 
-
 #------------------------------------------------------------------------------
 
 class TestMaskedArrayAttributes(TestCase):
 
-
     def test_keepmask(self):
         "Tests the keep mask flag"
         x = masked_array([1, 2, 3], mask=[1, 0, 0])
@@ -1173,7 +1188,7 @@
         n = [0, 0, 0, 1, 1]
         m = make_mask(n)
         xh = array(d, mask=m, hard_mask=True)
-        # We need to copy, to avoid updating d in xh!
+        # We need to copy, to avoid updating d in xh !
         xs = array(d, mask=m, hard_mask=False, copy=True)
         xh[[1, 4]] = [10, 40]
         xs[[1, 4]] = [10, 40]
@@ -1223,7 +1238,7 @@
         xh[filled(xh < 5, False)] = 2
         assert_equal(xh._data, [[1, 2], [2, 5]])
         assert_equal(xh._mask, [[1, 0], [0, 0]])
-        #
+
     def test_hardmask_again(self):
         "Another test of hardmask"
         d = arange(5)
@@ -1283,9 +1298,6 @@
         testflat[:] = testflat[[2, 1, 0]]
         assert_equal(test, control)
 
-
-
-
 #------------------------------------------------------------------------------
 
 class TestFillingValues(TestCase):
@@ -1482,15 +1494,35 @@
         assert(np.isnan(f[0]))
         assert_equal(f[-1], default_fill_value(1.))
 
+    def test_fillvalue_as_arguments(self):
+        "Test adding a fill_value parameter to empty/ones/zeros"
+        a = empty(3, fill_value=999.)
+        assert_equal(a.fill_value, 999.)
+        #
+        a = ones(3, fill_value=999., dtype=float)
+        assert_equal(a.fill_value, 999.)
+        #
+        a = zeros(3, fill_value=0., dtype=complex)
+        assert_equal(a.fill_value, 0.)
+        #
+        a = identity(3, fill_value=0., dtype=complex)
+        assert_equal(a.fill_value, 0.)
+
 #------------------------------------------------------------------------------
 
 class TestUfuncs(TestCase):
     "Test class for the application of ufuncs on MaskedArrays."
+
     def setUp(self):
         "Base data definition."
         self.d = (array([1.0, 0, -1, pi / 2] * 2, mask=[0, 1] + [0] * 6),
                   array([1.0, 0, -1, pi / 2] * 2, mask=[1, 0] + [0] * 6),)
+        self.err_status = np.geterr()
+        np.seterr(divide='ignore', invalid='ignore')
 
+    def tearDown(self):
+        np.seterr(**self.err_status)
+
     def test_testUfuncRegression(self):
         "Tests new ufuncs on MaskedArrays."
         for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
@@ -1522,7 +1554,7 @@
             mr = mf(*args)
             assert_equal(ur.filled(0), mr.filled(0), f)
             assert_mask_equal(ur.mask, mr.mask, err_msg=f)
-    #........................
+
     def test_reduce(self):
         "Tests reduce on MaskedArrays."
         a = self.d[0]
@@ -1531,7 +1563,7 @@
         assert_equal(sum(a[:3], axis=0), 0)
         assert_equal(product(a, axis=0), 0)
         assert_equal(add.reduce(a), pi)
-    #........................
+
     def test_minmax(self):
         "Tests extrema on MaskedArrays."
         a = arange(1, 13).reshape(3, 4)
@@ -1553,7 +1585,6 @@
         assert_equal(test.mask, control.mask)
         self.assertTrue(not isinstance(test.mask, MaskedArray))
 
-
 #------------------------------------------------------------------------------
 
 class TestMaskedArrayInPlaceArithmetics(TestCase):
@@ -2109,7 +2140,7 @@
         self.assertTrue(x[3] is masked)
         self.assertTrue(x[4] is masked)
         x[[1, 4]] = [10, 40]
-#        self.assertTrue( x.mask is not m)
+        #self.assertTrue(x.mask is not m)
         self.assertTrue(x[3] is masked)
         self.assertTrue(x[4] is not masked)
         assert_equal(x, [0, 10, 2, -1, 40])
@@ -2185,7 +2216,7 @@
         aravel = a.ravel()
         assert_equal(a.shape, (1, 5))
         assert_equal(a._mask.shape, a.shape)
-        # Checs that small_mask is preserved
+        # Checks that small_mask is preserved
         a = array([1, 2, 3, 4], mask=[0, 0, 0, 0], shrink=False)
         assert_equal(a.ravel()._mask, [0, 0, 0, 0])
         # Test that the fill_value is preserved
@@ -2367,7 +2398,7 @@
         xlist = x.tolist()
         self.assertTrue(xlist[1] is None)
         self.assertTrue(xlist[-2] is None)
-        # ... on 2D
+       # ... on 2D
         x.shape = (3, 4)
         xlist = x.tolist()
         ctrl = [[0, None, 2, 3], [4, 5, 6, 7], [8, 9, None, 11]]
@@ -2738,7 +2769,7 @@
 
 class TestMaskedArrayFunctions(TestCase):
     "Test class for miscellaneous functions."
-    #
+
     def setUp(self):
         x = np.array([1., 1., 1., -2., pi / 2.0, 4., 5., -10., 10., 1., 2., 3.])
         y = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
@@ -2900,7 +2931,7 @@
         zm = masked_array(z, mask=[0, 1, 0, 0])
         xf = np.where(m1, 1e+20, x)
         xm.set_fill_value(1e+20)
-
+        #
         d = where(xm > 2, xm, -9)
         assert_equal(d, [-9., -9., -9., -9., -9., 4., -9., -9., 10., -9., -9., 3.])
         assert_equal(d._mask, xm._mask)
@@ -3128,15 +3159,15 @@
         test = mask_or(mask, False)
         assert_equal(test, mask)
         # Using True as input. Won't work, but keep it for the kicks
-        #test = ma.mask_or(mask, True)
-        #control = np.array([(1, 1), (1, 1), (1, 1), (1, 1)], dtype=mtype)
-        #assert_equal(test, control)
-        # Using another array w/ the same dtype
+        # test = mask_or(mask, True)
+        # control = np.array([(1, 1), (1, 1), (1, 1), (1, 1)], dtype=mtype)
+        # assert_equal(test, control)
+        # Using another array w / the same dtype
         other = np.array([(0, 1), (0, 1), (0, 1), (0, 1)], dtype=mtype)
         test = mask_or(mask, other)
         control = np.array([(0, 1), (0, 1), (1, 1), (0, 1)], dtype=mtype)
         assert_equal(test, control)
-        # Using another array w/ a different dtype
+        # Using another array w / a different dtype
         othertype = [('A', np.bool), ('B', np.bool)]
         other = np.array([(0, 1), (0, 1), (0, 1), (0, 1)], dtype=othertype)
         try:
@@ -3302,7 +3333,6 @@
         assert_equal_records(a[-2]._data, a._data[-2])
         assert_equal_records(a[-2]._mask, a._mask[-2])
 
-
 #------------------------------------------------------------------------------
 
 class TestMaskedView(TestCase):
@@ -3389,6 +3419,5 @@
     assert_equal(np.argwhere(a), [[1], [3]])
 
 ###############################################################################
-#------------------------------------------------------------------------------
 if __name__ == "__main__":
     run_module_suite()

Modified: trunk/numpy/ma/tests/test_old_ma.py
===================================================================
--- trunk/numpy/ma/tests/test_old_ma.py	2010-03-17 21:04:15 UTC (rev 8294)
+++ trunk/numpy/ma/tests/test_old_ma.py	2010-03-18 15:23:08 UTC (rev 8295)
@@ -10,29 +10,29 @@
     from functools import reduce
 
 pi = numpy.pi
-def eq(v,w, msg=''):
-    result = allclose(v,w)
+def eq(v, w, msg=''):
+    result = allclose(v, w)
     if not result:
         print """Not eq:%s
 %s
 ----
-%s"""% (msg, str(v), str(w))
+%s""" % (msg, str(v), str(w))
     return result
 
 class TestMa(TestCase):
     def setUp (self):
-        x=numpy.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
-        y=numpy.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
+        x = numpy.array([1., 1., 1., -2., pi / 2.0, 4., 5., -10., 10., 1., 2., 3.])
+        y = numpy.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
         a10 = 10.
         m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
-        m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 ,0, 1]
+        m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 , 0, 1]
         xm = array(x, mask=m1)
         ym = array(y, mask=m2)
         z = numpy.array([-.5, 0., .5, .8])
-        zm = array(z, mask=[0,1,0,0])
-        xf = numpy.where(m1, 1.e+20, x)
+        zm = array(z, mask=[0, 1, 0, 0])
+        xf = numpy.where(m1, 1e+20, x)
         s = x.shape
-        xm.set_fill_value(1.e+20)
+        xm.set_fill_value(1e+20)
         self.d = (x, y, a10, m1, m2, xm, ym, z, zm, xf, s)
 
     def test_testBasic1d(self):
@@ -43,15 +43,15 @@
         self.assertEqual(shape(xm), s)
         self.assertEqual(xm.shape, s)
         self.assertEqual(xm.dtype, x.dtype)
-        self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))
-        self.assertEqual(count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))
+        self.assertEqual(xm.size , reduce(lambda x, y:x * y, s))
+        self.assertEqual(count(xm) , len(m1) - reduce(lambda x, y:x + y, m1))
         self.assertTrue(eq(xm, xf))
         self.assertTrue(eq(filled(xm, 1.e20), xf))
         self.assertTrue(eq(x, xm))
 
     def test_testBasic2d(self):
         "Test of basic array creation and properties in 2 dimensions."
-        for s in [(4,3), (6,2)]:
+        for s in [(4, 3), (6, 2)]:
             (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
             x.shape = s
             y.shape = s
@@ -63,8 +63,8 @@
             self.assertTrue(isMaskedArray(xm))
             self.assertEqual(shape(xm), s)
             self.assertEqual(xm.shape, s)
-            self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))
-            self.assertEqual( count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))
+            self.assertEqual(xm.size , reduce(lambda x, y:x * y, s))
+            self.assertEqual(count(xm) , len(m1) - reduce(lambda x, y:x + y, m1))
             self.assertTrue(eq(xm, xf))
             self.assertTrue(eq(filled(xm, 1.e20), xf))
             self.assertTrue(eq(x, xm))
@@ -73,12 +73,12 @@
     def test_testArithmetic (self):
         "Test of basic arithmetic."
         (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
-        a2d = array([[1,2],[0,4]])
-        a2dm = masked_array(a2d, [[0,0],[1,0]])
+        a2d = array([[1, 2], [0, 4]])
+        a2dm = masked_array(a2d, [[0, 0], [1, 0]])
         self.assertTrue(eq (a2d * a2d, a2d * a2dm))
         self.assertTrue(eq (a2d + a2d, a2d + a2dm))
         self.assertTrue(eq (a2d - a2d, a2d - a2dm))
-        for s in [(12,), (4,3), (2,6)]:
+        for s in [(12,), (4, 3), (2, 6)]:
             x = x.reshape(s)
             y = y.reshape(s)
             xm = xm.reshape(s)
@@ -105,15 +105,15 @@
             self.assertTrue(eq(x - a10, xm - a10))
             self.assertTrue(eq(x * a10, xm * a10))
             self.assertTrue(eq(x / a10, xm / a10))
-            self.assertTrue(eq(x**2, xm**2))
-            self.assertTrue(eq(abs(x)**2.5, abs(xm) **2.5))
-            self.assertTrue(eq(x**y, xm**ym))
-            self.assertTrue(eq(numpy.add(x,y), add(xm, ym)))
-            self.assertTrue(eq(numpy.subtract(x,y), subtract(xm, ym)))
-            self.assertTrue(eq(numpy.multiply(x,y), multiply(xm, ym)))
+            self.assertTrue(eq(x ** 2, xm ** 2))
+            self.assertTrue(eq(abs(x) ** 2.5, abs(xm) ** 2.5))
+            self.assertTrue(eq(x ** y, xm ** ym))
+            self.assertTrue(eq(numpy.add(x, y), add(xm, ym)))
+            self.assertTrue(eq(numpy.subtract(x, y), subtract(xm, ym)))
+            self.assertTrue(eq(numpy.multiply(x, y), multiply(xm, ym)))
             olderr = numpy.seterr(divide='ignore', invalid='ignore')
             try:
-                self.assertTrue(eq(numpy.divide(x,y), divide(xm, ym)))
+                self.assertTrue(eq(numpy.divide(x, y), divide(xm, ym)))
             finally:
                 numpy.seterr(**olderr)
 
@@ -146,37 +146,37 @@
         self.assertTrue (eq(numpy.arctan(z), arctan(zm)))
         self.assertTrue (eq(numpy.arctan2(x, y), arctan2(xm, ym)))
         self.assertTrue (eq(numpy.absolute(x), absolute(xm)))
-        self.assertTrue (eq(numpy.equal(x,y), equal(xm, ym)))
-        self.assertTrue (eq(numpy.not_equal(x,y), not_equal(xm, ym)))
-        self.assertTrue (eq(numpy.less(x,y), less(xm, ym)))
-        self.assertTrue (eq(numpy.greater(x,y), greater(xm, ym)))
-        self.assertTrue (eq(numpy.less_equal(x,y), less_equal(xm, ym)))
-        self.assertTrue (eq(numpy.greater_equal(x,y), greater_equal(xm, ym)))
+        self.assertTrue (eq(numpy.equal(x, y), equal(xm, ym)))
+        self.assertTrue (eq(numpy.not_equal(x, y), not_equal(xm, ym)))
+        self.assertTrue (eq(numpy.less(x, y), less(xm, ym)))
+        self.assertTrue (eq(numpy.greater(x, y), greater(xm, ym)))
+        self.assertTrue (eq(numpy.less_equal(x, y), less_equal(xm, ym)))
+        self.assertTrue (eq(numpy.greater_equal(x, y), greater_equal(xm, ym)))
         self.assertTrue (eq(numpy.conjugate(x), conjugate(xm)))
-        self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((xm,ym))))
-        self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((x,y))))
-        self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((xm,y))))
-        self.assertTrue (eq(numpy.concatenate((x,y,x)), concatenate((x,ym,x))))
+        self.assertTrue (eq(numpy.concatenate((x, y)), concatenate((xm, ym))))
+        self.assertTrue (eq(numpy.concatenate((x, y)), concatenate((x, y))))
+        self.assertTrue (eq(numpy.concatenate((x, y)), concatenate((xm, y))))
+        self.assertTrue (eq(numpy.concatenate((x, y, x)), concatenate((x, ym, x))))
 
     def test_xtestCount (self):
         "Test count"
-        ott = array([0.,1.,2.,3.], mask=[1,0,0,0])
+        ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
         if sys.version_info[0] >= 3:
-            self.assertTrue( isinstance(count(ott), numpy.integer))
+            self.assertTrue(isinstance(count(ott), numpy.integer))
         else:
-            self.assertTrue( isinstance(count(ott), types.IntType))
+            self.assertTrue(isinstance(count(ott), types.IntType))
         self.assertEqual(3, count(ott))
         self.assertEqual(1, count(1))
-        self.assertTrue (eq(0, array(1,mask=[1])))
-        ott=ott.reshape((2,2))
-        assert isinstance(count(ott,0),numpy.ndarray)
+        self.assertTrue (eq(0, array(1, mask=[1])))
+        ott = ott.reshape((2, 2))
+        assert isinstance(count(ott, 0), numpy.ndarray)
         if sys.version_info[0] >= 3:
             assert isinstance(count(ott), numpy.integer)
         else:
             assert isinstance(count(ott), types.IntType)
         self.assertTrue (eq(3, count(ott)))
-        assert getmask(count(ott,0)) is nomask
-        self.assertTrue (eq([1,2],count(ott,0)))
+        assert getmask(count(ott, 0)) is nomask
+        self.assertTrue (eq([1, 2], count(ott, 0)))
 
     def test_testMinMax (self):
         "Test minimum and maximum."
@@ -195,65 +195,65 @@
         (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
         self.assertTrue (eq(numpy.add.reduce(x), add.reduce(x)))
         self.assertTrue (eq(numpy.add.accumulate(x), add.accumulate(x)))
-        self.assertTrue (eq(4, sum(array(4),axis=0)))
         self.assertTrue (eq(4, sum(array(4), axis=0)))
-        self.assertTrue (eq(numpy.sum(x,axis=0), sum(x,axis=0)))
-        self.assertTrue (eq(numpy.sum(filled(xm,0),axis=0), sum(xm,axis=0)))
-        self.assertTrue (eq(numpy.sum(x,0), sum(x,0)))
-        self.assertTrue (eq(numpy.product(x,axis=0), product(x,axis=0)))
-        self.assertTrue (eq(numpy.product(x,0), product(x,0)))
-        self.assertTrue (eq(numpy.product(filled(xm,1),axis=0),
-                            product(xm,axis=0)))
+        self.assertTrue (eq(4, sum(array(4), axis=0)))
+        self.assertTrue (eq(numpy.sum(x, axis=0), sum(x, axis=0)))
+        self.assertTrue (eq(numpy.sum(filled(xm, 0), axis=0), sum(xm, axis=0)))
+        self.assertTrue (eq(numpy.sum(x, 0), sum(x, 0)))
+        self.assertTrue (eq(numpy.product(x, axis=0), product(x, axis=0)))
+        self.assertTrue (eq(numpy.product(x, 0), product(x, 0)))
+        self.assertTrue (eq(numpy.product(filled(xm, 1), axis=0),
+                            product(xm, axis=0)))
         if len(s) > 1:
-            self.assertTrue (eq(numpy.concatenate((x,y),1),
-                                concatenate((xm,ym),1)))
-            self.assertTrue (eq(numpy.add.reduce(x,1), add.reduce(x,1)))
-            self.assertTrue (eq(numpy.sum(x,1), sum(x,1)))
-            self.assertTrue (eq(numpy.product(x,1), product(x,1)))
+            self.assertTrue (eq(numpy.concatenate((x, y), 1),
+                                concatenate((xm, ym), 1)))
+            self.assertTrue (eq(numpy.add.reduce(x, 1), add.reduce(x, 1)))
+            self.assertTrue (eq(numpy.sum(x, 1), sum(x, 1)))
+            self.assertTrue (eq(numpy.product(x, 1), product(x, 1)))
 
 
     def test_testCI(self):
         "Test of conversions and indexing"
-        x1 = numpy.array([1,2,4,3])
-        x2 = array(x1, mask = [1,0,0,0])
-        x3 = array(x1, mask = [0,1,0,1])
+        x1 = numpy.array([1, 2, 4, 3])
+        x2 = array(x1, mask=[1, 0, 0, 0])
+        x3 = array(x1, mask=[0, 1, 0, 1])
         x4 = array(x1)
     # test conversion to strings
         junk, garbage = str(x2), repr(x2)
-        assert eq(numpy.sort(x1),sort(x2, fill_value=0))
+        assert eq(numpy.sort(x1), sort(x2, fill_value=0))
     # tests of indexing
         assert type(x2[1]) is type(x1[1])
         assert x1[1] == x2[1]
         assert x2[0] is masked
-        assert eq(x1[2],x2[2])
-        assert eq(x1[2:5],x2[2:5])
-        assert eq(x1[:],x2[:])
+        assert eq(x1[2], x2[2])
+        assert eq(x1[2:5], x2[2:5])
+        assert eq(x1[:], x2[:])
         assert eq(x1[1:], x3[1:])
-        x1[2]=9
-        x2[2]=9
-        assert eq(x1,x2)
+        x1[2] = 9
+        x2[2] = 9
+        assert eq(x1, x2)
         x1[1:3] = 99
         x2[1:3] = 99
-        assert eq(x1,x2)
+        assert eq(x1, x2)
         x2[1] = masked
-        assert eq(x1,x2)
-        x2[1:3]=masked
-        assert eq(x1,x2)
+        assert eq(x1, x2)
+        x2[1:3] = masked
+        assert eq(x1, x2)
         x2[:] = x1
         x2[1] = masked
-        assert allequal(getmask(x2),array([0,1,0,0]))
-        x3[:] = masked_array([1,2,3,4],[0,1,1,0])
-        assert allequal(getmask(x3), array([0,1,1,0]))
-        x4[:] = masked_array([1,2,3,4],[0,1,1,0])
-        assert allequal(getmask(x4), array([0,1,1,0]))
-        assert allequal(x4, array([1,2,3,4]))
-        x1 = numpy.arange(5)*1.0
+        assert allequal(getmask(x2), array([0, 1, 0, 0]))
+        x3[:] = masked_array([1, 2, 3, 4], [0, 1, 1, 0])
+        assert allequal(getmask(x3), array([0, 1, 1, 0]))
+        x4[:] = masked_array([1, 2, 3, 4], [0, 1, 1, 0])
+        assert allequal(getmask(x4), array([0, 1, 1, 0]))
+        assert allequal(x4, array([1, 2, 3, 4]))
+        x1 = numpy.arange(5) * 1.0
         x2 = masked_values(x1, 3.0)
-        assert eq(x1,x2)
-        assert allequal(array([0,0,0,1,0],MaskType), x2.mask)
+        assert eq(x1, x2)
+        assert allequal(array([0, 0, 0, 1, 0], MaskType), x2.mask)
         assert eq(3.0, x2.fill_value)
-        x1 = array([1,'hello',2,3],object)
-        x2 = numpy.array([1,'hello',2,3],object)
+        x1 = array([1, 'hello', 2, 3], object)
+        x2 = numpy.array([1, 'hello', 2, 3], object)
         s1 = x1[1]
         s2 = x2[1]
         self.assertEqual(type(s2), str)
@@ -263,7 +263,7 @@
 
     def test_testCopySize(self):
         "Tests of some subtle points of copying and sizing."
-        n = [0,0,1,0,0]
+        n = [0, 0, 1, 0, 0]
         m = make_mask(n)
         m2 = make_mask(m)
         self.assertTrue(m is m2)
@@ -272,53 +272,53 @@
 
         x1 = numpy.arange(5)
         y1 = array(x1, mask=m)
-        self.assertTrue( y1._data is not x1)
-        self.assertTrue( allequal(x1,y1._data))
-        self.assertTrue( y1.mask is m)
+        self.assertTrue(y1._data is not x1)
+        self.assertTrue(allequal(x1, y1._data))
+        self.assertTrue(y1.mask is m)
 
         y1a = array(y1, copy=0)
-        self.assertTrue( y1a.mask is y1.mask)
+        self.assertTrue(y1a.mask is y1.mask)
 
         y2 = array(x1, mask=m, copy=0)
-        self.assertTrue( y2.mask is m)
-        self.assertTrue( y2[2] is masked)
-        y2[2]=9
-        self.assertTrue( y2[2] is not masked)
-        self.assertTrue( y2.mask is not m)
-        self.assertTrue( allequal(y2.mask, 0))
+        self.assertTrue(y2.mask is m)
+        self.assertTrue(y2[2] is masked)
+        y2[2] = 9
+        self.assertTrue(y2[2] is not masked)
+        self.assertTrue(y2.mask is not m)
+        self.assertTrue(allequal(y2.mask, 0))
 
-        y3 = array(x1*1.0, mask=m)
-        self.assertTrue(filled(y3).dtype is (x1*1.0).dtype)
+        y3 = array(x1 * 1.0, mask=m)
+        self.assertTrue(filled(y3).dtype is (x1 * 1.0).dtype)
 
         x4 = arange(4)
         x4[2] = masked
         y4 = resize(x4, (8,))
-        self.assertTrue( eq(concatenate([x4,x4]), y4))
-        self.assertTrue( eq(getmask(y4),[0,0,1,0,0,0,1,0]))
-        y5 = repeat(x4, (2,2,2,2), axis=0)
-        self.assertTrue( eq(y5, [0,0,1,1,2,2,3,3]))
+        self.assertTrue(eq(concatenate([x4, x4]), y4))
+        self.assertTrue(eq(getmask(y4), [0, 0, 1, 0, 0, 0, 1, 0]))
+        y5 = repeat(x4, (2, 2, 2, 2), axis=0)
+        self.assertTrue(eq(y5, [0, 0, 1, 1, 2, 2, 3, 3]))
         y6 = repeat(x4, 2, axis=0)
-        self.assertTrue( eq(y5, y6))
+        self.assertTrue(eq(y5, y6))
 
     def test_testPut(self):
         "Test of put"
         d = arange(5)
-        n = [0,0,0,1,1]
+        n = [0, 0, 0, 1, 1]
         m = make_mask(n)
-        x = array(d, mask = m)
-        self.assertTrue( x[3] is masked)
-        self.assertTrue( x[4] is masked)
-        x[[1,4]] = [10,40]
-        self.assertTrue( x.mask is not m)
-        self.assertTrue( x[3] is masked)
-        self.assertTrue( x[4] is not masked)
-        self.assertTrue( eq(x, [0,10,2,-1,40]))
+        x = array(d, mask=m)
+        self.assertTrue(x[3] is masked)
+        self.assertTrue(x[4] is masked)
+        x[[1, 4]] = [10, 40]
+        self.assertTrue(x.mask is not m)
+        self.assertTrue(x[3] is masked)
+        self.assertTrue(x[4] is not masked)
+        self.assertTrue(eq(x, [0, 10, 2, -1, 40]))
 
-        x = array(d, mask = m)
-        x.put([0,1,2],[-1,100,200])
-        self.assertTrue( eq(x, [-1,100,200,0,0]))
-        self.assertTrue( x[3] is masked)
-        self.assertTrue( x[4] is masked)
+        x = array(d, mask=m)
+        x.put([0, 1, 2], [-1, 100, 200])
+        self.assertTrue(eq(x, [-1, 100, 200, 0, 0]))
+        self.assertTrue(x[3] is masked)
+        self.assertTrue(x[4] is masked)
 
     def test_testMaPut(self):
         (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
@@ -329,21 +329,21 @@
 
     def test_testOddFeatures(self):
         "Test of other odd features"
-        x = arange(20); x=x.reshape(4,5)
+        x = arange(20); x = x.reshape(4, 5)
         x.flat[5] = 12
-        assert x[1,0] == 12
+        assert x[1, 0] == 12
         z = x + 10j * x
         assert eq(z.real, x)
-        assert eq(z.imag, 10*x)
-        assert eq((z*conjugate(z)).real, 101*x*x)
+        assert eq(z.imag, 10 * x)
+        assert eq((z * conjugate(z)).real, 101 * x * x)
         z.imag[...] = 0.0
 
         x = arange(10)
         x[3] = masked
         assert str(x[3]) == str(masked)
         c = x >= 8
-        assert count(where(c,masked,masked)) == 0
-        assert shape(where(c,masked,masked)) == c.shape
+        assert count(where(c, masked, masked)) == 0
+        assert shape(where(c, masked, masked)) == c.shape
         z = where(c , x, masked)
         assert z.dtype is x.dtype
         assert z[3] is masked
@@ -351,7 +351,7 @@
         assert z[7] is masked
         assert z[8] is not masked
         assert z[9] is not masked
-        assert eq(x,z)
+        assert eq(x, z)
         z = where(c , masked, x)
         assert z.dtype is x.dtype
         assert z[3] is masked
@@ -366,72 +366,72 @@
         assert z[7] is not masked
         assert z[8] is masked
         assert z[9] is masked
-        assert eq(x,z)
-        x = array([1.,2.,3.,4.,5.])
-        c = array([1,1,1,0,0])
+        assert eq(x, z)
+        x = array([1., 2., 3., 4., 5.])
+        c = array([1, 1, 1, 0, 0])
         x[2] = masked
         z = where(c, x, -x)
-        assert eq(z, [1.,2.,0., -4., -5])
+        assert eq(z, [1., 2., 0., -4., -5])
         c[0] = masked
         z = where(c, x, -x)
-        assert eq(z, [1.,2.,0., -4., -5])
+        assert eq(z, [1., 2., 0., -4., -5])
         assert z[0] is masked
         assert z[1] is not masked
         assert z[2] is masked
-        assert eq(masked_where(greater(x, 2), x), masked_greater(x,2))
+        assert eq(masked_where(greater(x, 2), x), masked_greater(x, 2))
         assert eq(masked_where(greater_equal(x, 2), x),
-                  masked_greater_equal(x,2))
-        assert eq(masked_where(less(x, 2), x), masked_less(x,2))
-        assert eq(masked_where(less_equal(x, 2), x), masked_less_equal(x,2))
-        assert eq(masked_where(not_equal(x, 2), x), masked_not_equal(x,2))
-        assert eq(masked_where(equal(x, 2), x), masked_equal(x,2))
-        assert eq(masked_where(not_equal(x,2), x), masked_not_equal(x,2))
+                  masked_greater_equal(x, 2))
+        assert eq(masked_where(less(x, 2), x), masked_less(x, 2))
+        assert eq(masked_where(less_equal(x, 2), x), masked_less_equal(x, 2))
+        assert eq(masked_where(not_equal(x, 2), x), masked_not_equal(x, 2))
+        assert eq(masked_where(equal(x, 2), x), masked_equal(x, 2))
+        assert eq(masked_where(not_equal(x, 2), x), masked_not_equal(x, 2))
         assert eq(masked_inside(range(5), 1, 3), [0, 199, 199, 199, 4])
-        assert eq(masked_outside(range(5), 1, 3),[199,1,2,3,199])
-        assert eq(masked_inside(array(range(5), mask=[1,0,0,0,0]), 1, 3).mask,
-                  [1,1,1,1,0])
-        assert eq(masked_outside(array(range(5), mask=[0,1,0,0,0]), 1, 3).mask,
-                  [1,1,0,0,1])
-        assert eq(masked_equal(array(range(5), mask=[1,0,0,0,0]), 2).mask,
-                  [1,0,1,0,0])
-        assert eq(masked_not_equal(array([2,2,1,2,1], mask=[1,0,0,0,0]), 2).mask,
-                  [1,0,1,0,1])
-        assert eq(masked_where([1,1,0,0,0], [1,2,3,4,5]), [99,99,3,4,5])
-        atest = ones((10,10,10), dtype=float32)
+        assert eq(masked_outside(range(5), 1, 3), [199, 1, 2, 3, 199])
+        assert eq(masked_inside(array(range(5), mask=[1, 0, 0, 0, 0]), 1, 3).mask,
+                  [1, 1, 1, 1, 0])
+        assert eq(masked_outside(array(range(5), mask=[0, 1, 0, 0, 0]), 1, 3).mask,
+                  [1, 1, 0, 0, 1])
+        assert eq(masked_equal(array(range(5), mask=[1, 0, 0, 0, 0]), 2).mask,
+                  [1, 0, 1, 0, 0])
+        assert eq(masked_not_equal(array([2, 2, 1, 2, 1], mask=[1, 0, 0, 0, 0]), 2).mask,
+                  [1, 0, 1, 0, 1])
+        assert eq(masked_where([1, 1, 0, 0, 0], [1, 2, 3, 4, 5]), [99, 99, 3, 4, 5])
+        atest = ones((10, 10, 10), dtype=float32)
         btest = zeros(atest.shape, MaskType)
-        ctest = masked_where(btest,atest)
-        assert eq(atest,ctest)
+        ctest = masked_where(btest, atest)
+        assert eq(atest, ctest)
         z = choose(c, (-x, x))
-        assert eq(z, [1.,2.,0., -4., -5])
+        assert eq(z, [1., 2., 0., -4., -5])
         assert z[0] is masked
         assert z[1] is not masked
         assert z[2] is masked
         x = arange(6)
         x[5] = masked
-        y = arange(6)*10
-        y[2]= masked
-        c = array([1,1,1,0,0,0], mask=[1,0,0,0,0,0])
+        y = arange(6) * 10
+        y[2] = masked
+        c = array([1, 1, 1, 0, 0, 0], mask=[1, 0, 0, 0, 0, 0])
         cm = c.filled(1)
-        z = where(c,x,y)
-        zm = where(cm,x,y)
+        z = where(c, x, y)
+        zm = where(cm, x, y)
         assert eq(z, zm)
         assert getmask(zm) is nomask
-        assert eq(zm, [0,1,2,30,40,50])
+        assert eq(zm, [0, 1, 2, 30, 40, 50])
         z = where(c, masked, 1)
-        assert eq(z, [99,99,99,1,1,1])
+        assert eq(z, [99, 99, 99, 1, 1, 1])
         z = where(c, 1, masked)
         assert eq(z, [99, 1, 1, 99, 99, 99])
 
     def test_testMinMax(self):
         "Test of minumum, maximum."
-        assert eq(minimum([1,2,3],[4,0,9]), [1,0,3])
-        assert eq(maximum([1,2,3],[4,0,9]), [4,2,9])
+        assert eq(minimum([1, 2, 3], [4, 0, 9]), [1, 0, 3])
+        assert eq(maximum([1, 2, 3], [4, 0, 9]), [4, 2, 9])
         x = arange(5)
         y = arange(5) - 2
         x[3] = masked
         y[0] = masked
-        assert eq(minimum(x,y), where(less(x,y), x, y))
-        assert eq(maximum(x,y), where(greater(x,y), x, y))
+        assert eq(minimum(x, y), where(less(x, y), x, y))
+        assert eq(maximum(x, y), where(greater(x, y), x, y))
         assert minimum(x) == 0
         assert maximum(x) == 4
 
@@ -440,17 +440,17 @@
         x = arange(24)
         y = numpy.arange(24)
         x[5:6] = masked
-        x=x.reshape(2,3,4)
-        y=y.reshape(2,3,4)
-        assert eq(numpy.transpose(y,(2,0,1)), transpose(x,(2,0,1)))
-        assert eq(numpy.take(y, (2,0,1), 1), take(x, (2,0,1), 1))
-        assert eq(numpy.inner(filled(x,0),filled(y,0)),
+        x = x.reshape(2, 3, 4)
+        y = y.reshape(2, 3, 4)
+        assert eq(numpy.transpose(y, (2, 0, 1)), transpose(x, (2, 0, 1)))
+        assert eq(numpy.take(y, (2, 0, 1), 1), take(x, (2, 0, 1), 1))
+        assert eq(numpy.inner(filled(x, 0), filled(y, 0)),
                                 inner(x, y))
-        assert eq(numpy.outer(filled(x,0),filled(y,0)),
+        assert eq(numpy.outer(filled(x, 0), filled(y, 0)),
                                 outer(x, y))
         y = array(['abc', 1, 'def', 2, 3], object)
         y[2] = masked
-        t = take(y,[0,3,4])
+        t = take(y, [0, 3, 4])
         assert t[0] == 'abc'
         assert t[1] == 2
         assert t[2] == 3
@@ -463,27 +463,27 @@
         xm = arange(10)
         xm[2] = masked
         x += 1
-        assert eq(x, y+1)
+        assert eq(x, y + 1)
         xm += 1
-        assert eq(x, y+1)
+        assert eq(x, y + 1)
 
         x = arange(10)
         xm = arange(10)
         xm[2] = masked
         x -= 1
-        assert eq(x, y-1)
+        assert eq(x, y - 1)
         xm -= 1
-        assert eq(xm, y-1)
+        assert eq(xm, y - 1)
 
-        x = arange(10)*1.0
-        xm = arange(10)*1.0
+        x = arange(10) * 1.0
+        xm = arange(10) * 1.0
         xm[2] = masked
         x *= 2.0
-        assert eq(x, y*2)
+        assert eq(x, y * 2)
         xm *= 2.0
-        assert eq(xm, y*2)
+        assert eq(xm, y * 2)
 
-        x = arange(10)*2
+        x = arange(10) * 2
         xm = arange(10)
         xm[2] = masked
         x /= 2
@@ -491,11 +491,11 @@
         xm /= 2
         assert eq(x, y)
 
-        x = arange(10)*1.0
-        xm = arange(10)*1.0
+        x = arange(10) * 1.0
+        xm = arange(10) * 1.0
         xm[2] = masked
         x /= 2.0
-        assert eq(x, y/2.0)
+        assert eq(x, y / 2.0)
         xm /= arange(10)
         assert eq(xm, ones((10,)))
 
@@ -503,23 +503,23 @@
         xm = arange(10)
         xm[2] = masked
         x += 1.
-        assert eq(x, y+1.)
+        assert eq(x, y + 1.)
 
     def test_testPickle(self):
         "Test of pickling"
         import pickle
         x = arange(12)
         x[4:10:2] = masked
-        x = x.reshape(4,3)
+        x = x.reshape(4, 3)
         s = pickle.dumps(x)
         y = pickle.loads(s)
-        assert eq(x,y)
+        assert eq(x, y)
 
     def test_testMasked(self):
         "Test of masked element"
-        xx=arange(6)
+        xx = arange(6)
         xx[1] = masked
-        self.assertTrue(str(masked) ==  '--')
+        self.assertTrue(str(masked) == '--')
         self.assertTrue(xx[1] is masked)
         self.assertEqual(filled(xx[1], 0), 0)
         # don't know why these should raise an exception...
@@ -530,77 +530,77 @@
 
     def test_testAverage1(self):
         "Test of average."
-        ott = array([0.,1.,2.,3.], mask=[1,0,0,0])
-        self.assertTrue(eq(2.0, average(ott,axis=0)))
+        ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
+        self.assertTrue(eq(2.0, average(ott, axis=0)))
         self.assertTrue(eq(2.0, average(ott, weights=[1., 1., 2., 1.])))
-        result, wts = average(ott, weights=[1.,1.,2.,1.], returned=1)
+        result, wts = average(ott, weights=[1., 1., 2., 1.], returned=1)
         self.assertTrue(eq(2.0, result))
         self.assertTrue(wts == 4.0)
         ott[:] = masked
-        self.assertTrue(average(ott,axis=0) is masked)
-        ott = array([0.,1.,2.,3.], mask=[1,0,0,0])
-        ott=ott.reshape(2,2)
-        ott[:,1] = masked
-        self.assertTrue(eq(average(ott,axis=0), [2.0, 0.0]))
-        self.assertTrue(average(ott,axis=1)[0] is masked)
-        self.assertTrue(eq([2.,0.], average(ott, axis=0)))
+        self.assertTrue(average(ott, axis=0) is masked)
+        ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
+        ott = ott.reshape(2, 2)
+        ott[:, 1] = masked
+        self.assertTrue(eq(average(ott, axis=0), [2.0, 0.0]))
+        self.assertTrue(average(ott, axis=1)[0] is masked)
+        self.assertTrue(eq([2., 0.], average(ott, axis=0)))
         result, wts = average(ott, axis=0, returned=1)
         self.assertTrue(eq(wts, [1., 0.]))
 
     def test_testAverage2(self):
         "More tests of average."
-        w1 = [0,1,1,1,1,0]
-        w2 = [[0,1,1,1,1,0],[1,0,0,0,0,1]]
-        x=arange(6)
+        w1 = [0, 1, 1, 1, 1, 0]
+        w2 = [[0, 1, 1, 1, 1, 0], [1, 0, 0, 0, 0, 1]]
+        x = arange(6)
         self.assertTrue(allclose(average(x, axis=0), 2.5))
         self.assertTrue(allclose(average(x, axis=0, weights=w1), 2.5))
-        y=array([arange(6), 2.0*arange(6)])
+        y = array([arange(6), 2.0 * arange(6)])
         self.assertTrue(allclose(average(y, None),
-                                 numpy.add.reduce(numpy.arange(6))*3./12.))
-        self.assertTrue(allclose(average(y, axis=0), numpy.arange(6) * 3./2.))
+                                 numpy.add.reduce(numpy.arange(6)) * 3. / 12.))
+        self.assertTrue(allclose(average(y, axis=0), numpy.arange(6) * 3. / 2.))
         self.assertTrue(allclose(average(y, axis=1),
-                                 [average(x,axis=0), average(x,axis=0) * 2.0]))
-        self.assertTrue(allclose(average(y, None, weights=w2), 20./6.))
+                                 [average(x, axis=0), average(x, axis=0) * 2.0]))
+        self.assertTrue(allclose(average(y, None, weights=w2), 20. / 6.))
         self.assertTrue(allclose(average(y, axis=0, weights=w2),
-                                 [0.,1.,2.,3.,4.,10.]))
+                                 [0., 1., 2., 3., 4., 10.]))
         self.assertTrue(allclose(average(y, axis=1),
-                                 [average(x,axis=0), average(x,axis=0) * 2.0]))
+                                 [average(x, axis=0), average(x, axis=0) * 2.0]))
         m1 = zeros(6)
-        m2 = [0,0,1,1,0,0]
-        m3 = [[0,0,1,1,0,0],[0,1,1,1,1,0]]
+        m2 = [0, 0, 1, 1, 0, 0]
+        m3 = [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 0]]
         m4 = ones(6)
         m5 = [0, 1, 1, 1, 1, 1]
-        self.assertTrue(allclose(average(masked_array(x, m1),axis=0), 2.5))
-        self.assertTrue(allclose(average(masked_array(x, m2),axis=0), 2.5))
-        self.assertTrue(average(masked_array(x, m4),axis=0) is masked)
-        self.assertEqual(average(masked_array(x, m5),axis=0), 0.0)
-        self.assertEqual(count(average(masked_array(x, m4),axis=0)), 0)
+        self.assertTrue(allclose(average(masked_array(x, m1), axis=0), 2.5))
+        self.assertTrue(allclose(average(masked_array(x, m2), axis=0), 2.5))
+        self.assertTrue(average(masked_array(x, m4), axis=0) is masked)
+        self.assertEqual(average(masked_array(x, m5), axis=0), 0.0)
+        self.assertEqual(count(average(masked_array(x, m4), axis=0)), 0)
         z = masked_array(y, m3)
-        self.assertTrue(allclose(average(z, None), 20./6.))
-        self.assertTrue(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5]))
+        self.assertTrue(allclose(average(z, None), 20. / 6.))
+        self.assertTrue(allclose(average(z, axis=0), [0., 1., 99., 99., 4.0, 7.5]))
         self.assertTrue(allclose(average(z, axis=1), [2.5, 5.0]))
-        self.assertTrue(allclose( average(z,axis=0, weights=w2),
-                                  [0.,1., 99., 99., 4.0, 10.0]))
+        self.assertTrue(allclose(average(z, axis=0, weights=w2),
+                                  [0., 1., 99., 99., 4.0, 10.0]))
 
         a = arange(6)
         b = arange(6) * 3
-        r1, w1 = average([[a,b],[b,a]], axis=1, returned=1)
+        r1, w1 = average([[a, b], [b, a]], axis=1, returned=1)
         self.assertEqual(shape(r1) , shape(w1))
         self.assertEqual(r1.shape , w1.shape)
-        r2, w2 = average(ones((2,2,3)), axis=0, weights=[3,1], returned=1)
+        r2, w2 = average(ones((2, 2, 3)), axis=0, weights=[3, 1], returned=1)
         self.assertEqual(shape(w2) , shape(r2))
-        r2, w2 = average(ones((2,2,3)), returned=1)
+        r2, w2 = average(ones((2, 2, 3)), returned=1)
         self.assertEqual(shape(w2) , shape(r2))
-        r2, w2 = average(ones((2,2,3)), weights=ones((2,2,3)), returned=1)
+        r2, w2 = average(ones((2, 2, 3)), weights=ones((2, 2, 3)), returned=1)
         self.assertTrue(shape(w2) == shape(r2))
-        a2d = array([[1,2],[0,4]], float)
-        a2dm = masked_array(a2d, [[0,0],[1,0]])
+        a2d = array([[1, 2], [0, 4]], float)
+        a2dm = masked_array(a2d, [[0, 0], [1, 0]])
         a2da = average(a2d, axis=0)
         self.assertTrue(eq (a2da, [0.5, 3.0]))
         a2dma = average(a2dm, axis=0)
-        self.assertTrue(eq( a2dma, [1.0, 3.0]))
+        self.assertTrue(eq(a2dma, [1.0, 3.0]))
         a2dma = average(a2dm, axis=None)
-        self.assertTrue(eq(a2dma, 7./3.))
+        self.assertTrue(eq(a2dma, 7. / 3.))
         a2dma = average(a2dm, axis=1)
         self.assertTrue(eq(a2dma, [1.5, 4.0]))
 
@@ -609,13 +609,19 @@
         self.assertEqual(1.0, float(array(1)))
         self.assertEqual(1, int(array([[[1]]])))
         self.assertEqual(1.0, float(array([[1]])))
-        self.assertRaises(TypeError, float, array([1,1]))
-        self.assertRaises(ValueError, bool, array([0,1]))
-        self.assertRaises(ValueError, bool, array([0,0],mask=[0,1]))
+        self.assertRaises(TypeError, float, array([1, 1]))
+        self.assertRaises(ValueError, bool, array([0, 1]))
+        self.assertRaises(ValueError, bool, array([0, 0], mask=[0, 1]))
 
     def test_testScalarArithmetic(self):
         xm = array(0, mask=1)
-        self.assertTrue((1/array(0)).mask)
+        #TODO FIXME: Find out what the following raises a warning in r8247
+        err_status = numpy.geterr()
+        try:
+            numpy.seterr(divide='ignore')
+            self.assertTrue((1 / array(0)).mask)
+        finally:
+            numpy.seterr(**err_status)
         self.assertTrue((1 + xm).mask)
         self.assertTrue((-xm).mask)
         self.assertTrue((-xm).mask)
@@ -627,25 +633,25 @@
         self.assertEqual(str(xm), str(masked_print_option))
 
     def test_testArrayMethods(self):
-        a = array([1,3,2])
-        b = array([1,3,2], mask=[1,0,1])
+        a = array([1, 3, 2])
+        b = array([1, 3, 2], mask=[1, 0, 1])
         self.assertTrue(eq(a.any(), a._data.any()))
         self.assertTrue(eq(a.all(), a._data.all()))
         self.assertTrue(eq(a.argmax(), a._data.argmax()))
         self.assertTrue(eq(a.argmin(), a._data.argmin()))
-        self.assertTrue(eq(a.choose(0,1,2,3,4), a._data.choose(0,1,2,3,4)))
-        self.assertTrue(eq(a.compress([1,0,1]), a._data.compress([1,0,1])))
+        self.assertTrue(eq(a.choose(0, 1, 2, 3, 4), a._data.choose(0, 1, 2, 3, 4)))
+        self.assertTrue(eq(a.compress([1, 0, 1]), a._data.compress([1, 0, 1])))
         self.assertTrue(eq(a.conj(), a._data.conj()))
         self.assertTrue(eq(a.conjugate(), a._data.conjugate()))
-        m = array([[1,2],[3,4]])
+        m = array([[1, 2], [3, 4]])
         self.assertTrue(eq(m.diagonal(), m._data.diagonal()))
         self.assertTrue(eq(a.sum(), a._data.sum()))
-        self.assertTrue(eq(a.take([1,2]), a._data.take([1,2])))
+        self.assertTrue(eq(a.take([1, 2]), a._data.take([1, 2])))
         self.assertTrue(eq(m.transpose(), m._data.transpose()))
 
     def test_testArrayAttributes(self):
-        a = array([1,3,2])
-        b = array([1,3,2], mask=[1,0,1])
+        a = array([1, 3, 2])
+        b = array([1, 3, 2], mask=[1, 0, 1])
         self.assertEqual(a.ndim, 1)
 
     def test_testAPI(self):
@@ -653,21 +659,21 @@
                      if m not in dir(MaskedArray) and not m.startswith('_')])
 
     def test_testSingleElementSubscript(self):
-        a = array([1,3,2])
-        b = array([1,3,2], mask=[1,0,1])
+        a = array([1, 3, 2])
+        b = array([1, 3, 2], mask=[1, 0, 1])
         self.assertEqual(a[0].shape, ())
         self.assertEqual(b[0].shape, ())
         self.assertEqual(b[1].shape, ())
 
 class TestUfuncs(TestCase):
     def setUp(self):
-        self.d = (array([1.0, 0, -1, pi/2]*2, mask=[0,1]+[0]*6),
-                  array([1.0, 0, -1, pi/2]*2, mask=[1,0]+[0]*6),)
+        self.d = (array([1.0, 0, -1, pi / 2] * 2, mask=[0, 1] + [0] * 6),
+                  array([1.0, 0, -1, pi / 2] * 2, mask=[1, 0] + [0] * 6),)
 
 
     def test_testUfuncRegression(self):
         f_invalid_ignore = ['sqrt', 'arctanh', 'arcsin', 'arccos',
-                'arccosh', 'arctanh', 'log', 'log10','divide',
+                'arccosh', 'arctanh', 'log', 'log10', 'divide',
                 'true_divide', 'floor_divide', 'remainder', 'fmod']
         for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
                 'sin', 'cos', 'tan',
@@ -709,38 +715,38 @@
 
     def test_reduce(self):
         a = self.d[0]
-        self.assertFalse(alltrue(a,axis=0))
-        self.assertTrue(sometrue(a,axis=0))
-        self.assertEqual(sum(a[:3],axis=0), 0)
-        self.assertEqual(product(a,axis=0), 0)
+        self.assertFalse(alltrue(a, axis=0))
+        self.assertTrue(sometrue(a, axis=0))
+        self.assertEqual(sum(a[:3], axis=0), 0)
+        self.assertEqual(product(a, axis=0), 0)
 
     def test_minmax(self):
-        a = arange(1,13).reshape(3,4)
-        amask = masked_where(a < 5,a)
+        a = arange(1, 13).reshape(3, 4)
+        amask = masked_where(a < 5, a)
         self.assertEqual(amask.max(), a.max())
         self.assertEqual(amask.min(), 5)
         self.assertTrue((amask.max(0) == a.max(0)).all())
-        self.assertTrue((amask.min(0) == [5,6,7,8]).all())
+        self.assertTrue((amask.min(0) == [5, 6, 7, 8]).all())
         self.assertTrue(amask.max(1)[0].mask)
         self.assertTrue(amask.min(1)[0].mask)
 
     def test_nonzero(self):
         for t in "?bhilqpBHILQPfdgFDGO":
-            x = array([1,0,2,0], mask=[0,0,1,1])
+            x = array([1, 0, 2, 0], mask=[0, 0, 1, 1])
             self.assertTrue(eq(nonzero(x), [0]))
 
 
 class TestArrayMethods(TestCase):
 
     def setUp(self):
-        x = numpy.array([ 8.375,  7.545,  8.828,  8.5  ,  1.757,  5.928,
-                          8.43 ,  7.78 ,  9.865,  5.878,  8.979,  4.732,
-                          3.012,  6.022,  5.095,  3.116,  5.238,  3.957,
-                          6.04 ,  9.63 ,  7.712,  3.382,  4.489,  6.479,
-                          7.189,  9.645,  5.395,  4.961,  9.894,  2.893,
-                          7.357,  9.828,  6.272,  3.758,  6.693,  0.993])
-        X = x.reshape(6,6)
-        XX = x.reshape(3,2,2,3)
+        x = numpy.array([ 8.375, 7.545, 8.828, 8.5  , 1.757, 5.928,
+                          8.43 , 7.78 , 9.865, 5.878, 8.979, 4.732,
+                          3.012, 6.022, 5.095, 3.116, 5.238, 3.957,
+                          6.04 , 9.63 , 7.712, 3.382, 4.489, 6.479,
+                          7.189, 9.645, 5.395, 4.961, 9.894, 2.893,
+                          7.357, 9.828, 6.272, 3.758, 6.693, 0.993])
+        X = x.reshape(6, 6)
+        XX = x.reshape(3, 2, 2, 3)
 
         m = numpy.array([0, 1, 0, 1, 0, 0,
                          1, 0, 1, 1, 0, 1,
@@ -748,9 +754,9 @@
                          0, 0, 0, 1, 1, 1,
                          1, 0, 0, 1, 0, 0,
                          0, 0, 1, 0, 1, 0])
-        mx = array(data=x,mask=m)
-        mX = array(data=X,mask=m.reshape(X.shape))
-        mXX = array(data=XX,mask=m.reshape(XX.shape))
+        mx = array(data=x, mask=m)
+        mX = array(data=X, mask=m.reshape(X.shape))
+        mXX = array(data=XX, mask=m.reshape(XX.shape))
 
         m2 = numpy.array([1, 1, 0, 1, 0, 0,
                           1, 1, 1, 1, 0, 1,
@@ -758,73 +764,73 @@
                           0, 0, 0, 1, 1, 1,
                           1, 0, 0, 1, 1, 0,
                           0, 0, 1, 0, 1, 1])
-        m2x = array(data=x,mask=m2)
-        m2X = array(data=X,mask=m2.reshape(X.shape))
-        m2XX = array(data=XX,mask=m2.reshape(XX.shape))
-        self.d =  (x,X,XX,m,mx,mX,mXX)
+        m2x = array(data=x, mask=m2)
+        m2X = array(data=X, mask=m2.reshape(X.shape))
+        m2XX = array(data=XX, mask=m2.reshape(XX.shape))
+        self.d = (x, X, XX, m, mx, mX, mXX)
 
     #------------------------------------------------------
     def test_trace(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
+        (x, X, XX, m, mx, mX, mXX,) = self.d
         mXdiag = mX.diagonal()
         self.assertEqual(mX.trace(), mX.diagonal().compressed().sum())
         self.assertTrue(eq(mX.trace(),
-                           X.trace() - sum(mXdiag.mask*X.diagonal(),axis=0)))
+                           X.trace() - sum(mXdiag.mask * X.diagonal(), axis=0)))
 
     def test_clip(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
-        clipped = mx.clip(2,8)
-        self.assertTrue(eq(clipped.mask,mx.mask))
-        self.assertTrue(eq(clipped._data,x.clip(2,8)))
-        self.assertTrue(eq(clipped._data,mx._data.clip(2,8)))
+        (x, X, XX, m, mx, mX, mXX,) = self.d
+        clipped = mx.clip(2, 8)
+        self.assertTrue(eq(clipped.mask, mx.mask))
+        self.assertTrue(eq(clipped._data, x.clip(2, 8)))
+        self.assertTrue(eq(clipped._data, mx._data.clip(2, 8)))
 
     def test_ptp(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
-        (n,m) = X.shape
-        self.assertEqual(mx.ptp(),mx.compressed().ptp())
-        rows = numpy.zeros(n,numpy.float_)
-        cols = numpy.zeros(m,numpy.float_)
+        (x, X, XX, m, mx, mX, mXX,) = self.d
+        (n, m) = X.shape
+        self.assertEqual(mx.ptp(), mx.compressed().ptp())
+        rows = numpy.zeros(n, numpy.float_)
+        cols = numpy.zeros(m, numpy.float_)
         for k in range(m):
-            cols[k] = mX[:,k].compressed().ptp()
+            cols[k] = mX[:, k].compressed().ptp()
         for k in range(n):
             rows[k] = mX[k].compressed().ptp()
-        self.assertTrue(eq(mX.ptp(0),cols))
-        self.assertTrue(eq(mX.ptp(1),rows))
+        self.assertTrue(eq(mX.ptp(0), cols))
+        self.assertTrue(eq(mX.ptp(1), rows))
 
     def test_swapaxes(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
-        mXswapped = mX.swapaxes(0,1)
-        self.assertTrue(eq(mXswapped[-1],mX[:,-1]))
-        mXXswapped = mXX.swapaxes(0,2)
-        self.assertEqual(mXXswapped.shape,(2,2,3,3))
+        (x, X, XX, m, mx, mX, mXX,) = self.d
+        mXswapped = mX.swapaxes(0, 1)
+        self.assertTrue(eq(mXswapped[-1], mX[:, -1]))
+        mXXswapped = mXX.swapaxes(0, 2)
+        self.assertEqual(mXXswapped.shape, (2, 2, 3, 3))
 
 
     def test_cumprod(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
+        (x, X, XX, m, mx, mX, mXX,) = self.d
         mXcp = mX.cumprod(0)
-        self.assertTrue(eq(mXcp._data,mX.filled(1).cumprod(0)))
+        self.assertTrue(eq(mXcp._data, mX.filled(1).cumprod(0)))
         mXcp = mX.cumprod(1)
-        self.assertTrue(eq(mXcp._data,mX.filled(1).cumprod(1)))
+        self.assertTrue(eq(mXcp._data, mX.filled(1).cumprod(1)))
 
     def test_cumsum(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
+        (x, X, XX, m, mx, mX, mXX,) = self.d
         mXcp = mX.cumsum(0)
-        self.assertTrue(eq(mXcp._data,mX.filled(0).cumsum(0)))
+        self.assertTrue(eq(mXcp._data, mX.filled(0).cumsum(0)))
         mXcp = mX.cumsum(1)
-        self.assertTrue(eq(mXcp._data,mX.filled(0).cumsum(1)))
+        self.assertTrue(eq(mXcp._data, mX.filled(0).cumsum(1)))
 
     def test_varstd(self):
-        (x,X,XX,m,mx,mX,mXX,) = self.d
-        self.assertTrue(eq(mX.var(axis=None),mX.compressed().var()))
-        self.assertTrue(eq(mX.std(axis=None),mX.compressed().std()))
-        self.assertTrue(eq(mXX.var(axis=3).shape,XX.var(axis=3).shape))
-        self.assertTrue(eq(mX.var().shape,X.var().shape))
-        (mXvar0,mXvar1) = (mX.var(axis=0), mX.var(axis=1))
+        (x, X, XX, m, mx, mX, mXX,) = self.d
+        self.assertTrue(eq(mX.var(axis=None), mX.compressed().var()))
+        self.assertTrue(eq(mX.std(axis=None), mX.compressed().std()))
+        self.assertTrue(eq(mXX.var(axis=3).shape, XX.var(axis=3).shape))
+        self.assertTrue(eq(mX.var().shape, X.var().shape))
+        (mXvar0, mXvar1) = (mX.var(axis=0), mX.var(axis=1))
         for k in range(6):
-            self.assertTrue(eq(mXvar1[k],mX[k].compressed().var()))
-            self.assertTrue(eq(mXvar0[k],mX[:,k].compressed().var()))
+            self.assertTrue(eq(mXvar1[k], mX[k].compressed().var()))
+            self.assertTrue(eq(mXvar0[k], mX[:, k].compressed().var()))
             self.assertTrue(eq(numpy.sqrt(mXvar0[k]),
-                               mX[:,k].compressed().std()))
+                               mX[:, k].compressed().std()))
 
 
 def eqmask(m1, m2):



More information about the Numpy-svn mailing list