[Numpy-svn] r6095 - branches/1.2.x/numpy/ma

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Nov 22 19:13:51 EST 2008


Author: pierregm
Date: 2008-11-22 18:13:48 -0600 (Sat, 22 Nov 2008)
New Revision: 6095

Modified:
   branches/1.2.x/numpy/ma/core.py
Log:
Added mod to the ufuncs

Modified: branches/1.2.x/numpy/ma/core.py
===================================================================
--- branches/1.2.x/numpy/ma/core.py	2008-11-23 00:04:29 UTC (rev 6094)
+++ branches/1.2.x/numpy/ma/core.py	2008-11-23 00:13:48 UTC (rev 6095)
@@ -45,7 +45,7 @@
            'masked_object','masked_outside', 'masked_print_option',
            'masked_singleton','masked_values', 'masked_where', 'max', 'maximum',
            'maximum_fill_value', 'mean', 'min', 'minimum', 'minimum_fill_value',
-           'multiply',
+           'mod', 'multiply',
            'negative', 'nomask', 'nonzero', 'not_equal',
            'ones', 'outer', 'outerproduct',
            'power', 'product', 'ptp', 'put', 'putmask',
@@ -291,9 +291,12 @@
 
 #####--------------------------------------------------------------------------
 def filled(a, fill_value = None):
-    """Return a as an array with masked data replaced by value.  If
-    value is None, get_fill_value(a) is used instead.  If a is already
-    a ndarray, a itself is returned.
+    """
+    Return `a` as an array where masked data have been replaced by `value`.
+    
+    If `a` is not a MaskedArray, `a` itself is returned.
+    If `a` is a MaskedArray and `fill_value` is None, `fill_value` is set to
+    `a.fill_value`.
 
     Parameters
     ----------
@@ -764,6 +767,7 @@
 remainder = _DomainedBinaryOperation(umath.remainder,
                                       _DomainSafeDivide(), 0, 1)
 fmod = _DomainedBinaryOperation(umath.fmod, _DomainSafeDivide(), 0, 1)
+mod = _DomainedBinaryOperation(umath.mod, _DomainSafeDivide(), 0, 1)
 
 
 #####--------------------------------------------------------------------------
@@ -875,6 +879,7 @@
     else:
         return result
 
+
 def make_mask_none(newshape, dtype=None):
     """
     Return a mask of shape s, filled with False.
@@ -884,7 +889,8 @@
     news : tuple
         A tuple indicating the shape of the final mask.
     dtype: {None, dtype}, optional
-        A dtype.
+        If None, use MaskType. Otherwise, use a new datatype with the same fields
+        as `dtype` with boolean type.
 
     """
     if dtype is None:




More information about the Numpy-svn mailing list