Skip to content

Commit

Permalink
Added mod to the ufuncs
Browse files Browse the repository at this point in the history
  • Loading branch information
pierregm committed Nov 23, 2008
1 parent 1ce3a5b commit 9b327f9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions numpy/ma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -291,9 +291,12 @@ def common_fill_value(a, b):

#####--------------------------------------------------------------------------
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
----------
Expand Down Expand Up @@ -764,6 +767,7 @@ def __str__ (self):
remainder = _DomainedBinaryOperation(umath.remainder,
_DomainSafeDivide(), 0, 1)
fmod = _DomainedBinaryOperation(umath.fmod, _DomainSafeDivide(), 0, 1)
mod = _DomainedBinaryOperation(umath.mod, _DomainSafeDivide(), 0, 1)


#####--------------------------------------------------------------------------
Expand Down Expand Up @@ -875,6 +879,7 @@ def make_mask(m, copy=False, shrink=True, flag=None, dtype=MaskType):
else:
return result


def make_mask_none(newshape, dtype=None):
"""
Return a mask of shape s, filled with False.
Expand All @@ -884,7 +889,8 @@ def make_mask_none(newshape, dtype=None):
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:
Expand Down

0 comments on commit 9b327f9

Please sign in to comment.