numpy.ma.__init__ (version 1.0, $Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $)
index
/usr/lib/python2.6/dist-packages/numpy/ma/__init__.py

=============
Masked Arrays
=============
 
Arrays sometimes contain invalid or missing data.  When doing operations
on such arrays, we wish to suppress invalid values, which is the purpose masked
arrays fulfill (an example of typical use is given below).
 
For example, examine the following array:
 
>>> x = np.array([2, 1, 3, np.nan, 5, 2, 3, np.nan])
 
When we try to calculate the mean of the data, the result is undetermined:
 
>>> np.mean(x)
nan
 
The mean is calculated using roughly ``np.sum(x)/len(x)``, but since
any number added to ``NaN`` [1]_ produces ``NaN``, this doesn't work.  Enter
masked arrays:
 
>>> m = np.ma.masked_array(x, np.isnan(x))
>>> m
masked_array(data = [2.0 1.0 3.0 -- 5.0 2.0 3.0 --],
      mask = [False False False  True False False False  True],
      fill_value=1e+20)
 
Here, we construct a masked array that suppress all ``NaN`` values.  We
may now proceed to calculate the mean of the other values:
 
>>> np.mean(m)
2.6666666666666665
 
.. [1] Not-a-Number, a floating point value that is the result of an
       invalid operation.

 
Modules
       
numpy.ma.core
numpy.ma.extras

 
Data
        __all__ = ['core', 'extras', 'MAError', 'MaskError', 'MaskType', 'MaskedArray', 'bool_', 'abs', 'absolute', 'add', 'all', 'allclose', 'allequal', 'alltrue', 'amax', 'amin', 'anom', 'anomalies', 'any', 'arange', ...]
__author__ = 'Pierre GF Gerard-Marchant ($Author: jarrod.millman $)'
__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $'
__file__ = '/usr/lib/python2.6/dist-packages/numpy/ma/__init__.pyc'
__name__ = 'numpy.ma.__init__'
__package__ = 'numpy.ma'
__revision__ = '$Revision: 3473 $'
__version__ = '1.0'
abs = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e3b0>
absolute = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e3b0>
add = <numpy.ma.core._MaskedBinaryOperation instance at 0x246e9e0>
all = <numpy.ma.core._frommethod instance at 0x2472f38>
anom = <numpy.ma.core._frommethod instance at 0x2472fc8>
anomalies = <numpy.ma.core._frommethod instance at 0x2472fc8>
any = <numpy.ma.core._frommethod instance at 0x247a0e0>
arange = <numpy.ma.core._convert2ma instance at 0x247ac68>
arccos = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e878>
arccosh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e908>
arcsin = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e7e8>
arcsinh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e290>
arctan = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e248>
arctan2 = <numpy.ma.core._MaskedBinaryOperation instance at 0x246eab8>
arctanh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e998>
around = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e518>
bitwise_and = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ef38>
bitwise_or = <numpy.ma.core._MaskedBinaryOperation instance at 0x246efc8>
bitwise_xor = <numpy.ma.core._MaskedBinaryOperation instance at 0x2472098>
ceil = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e4d0>
column_stack = <numpy.ma.extras._fromnxfunction instance at 0x247d9e0>
compress = <numpy.ma.core._frommethod instance at 0x247a128>
conjugate = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e128>
copy = <numpy.ma.core._frommethod instance at 0x247a2d8>
cos = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e1b8>
cosh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e320>
cumprod = <numpy.ma.core._frommethod instance at 0x247a1b8>
cumsum = <numpy.ma.core._frommethod instance at 0x247a248>
diagflat = <numpy.ma.extras._fromnxfunction instance at 0x247dbd8>
diagonal = <numpy.ma.core._frommethod instance at 0x247a320>
divide = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472200>
dstack = <numpy.ma.extras._fromnxfunction instance at 0x247da70>
empty = <numpy.ma.core._convert2ma instance at 0x247ad40>
empty_like = <numpy.ma.core._convert2ma instance at 0x247add0>
equal = <numpy.ma.core._MaskedBinaryOperation instance at 0x246eb00>
exp = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e0e0>
fabs = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e3f8>
floor = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e488>
floor_divide = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472368>
fmod = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472518>
frombuffer = <numpy.ma.core._convert2ma instance at 0x247ad88>
fromfunction = <numpy.ma.core._convert2ma instance at 0x247ae60>
greater = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ecb0>
greater_equal = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ebd8>
harden_mask = <numpy.ma.core._frommethod instance at 0x247a3b0>
hsplit = <numpy.ma.extras._fromnxfunction instance at 0x247db00>
hstack = <numpy.ma.extras._fromnxfunction instance at 0x247d950>
hypot = <numpy.ma.core._MaskedBinaryOperation instance at 0x2472128>
identity = <numpy.ma.core._convert2ma instance at 0x247af38>
ids = <numpy.ma.core._frommethod instance at 0x247a368>
less = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ec20>
less_equal = <numpy.ma.core._MaskedBinaryOperation instance at 0x246eb90>
log = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e680>
log10 = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e710>
logical_and = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ed40>
logical_not = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e560>
logical_or = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ee18>
logical_xor = <numpy.ma.core._MaskedBinaryOperation instance at 0x246eea8>
masked = masked_array(data = --, mask = True, fill_value = 1e+20)
masked_print_option = --
masked_singleton = masked_array(data = --, mask = True, fill_value = 1e+20)
maximum = <numpy.ma.core._maximum_operation object at 0x24790d0>
mean = <numpy.ma.core._frommethod instance at 0x247a488>
minimum = <numpy.ma.core._minimum_operation object at 0x2479110>
mod = <numpy.ma.core._DomainedBinaryOperation instance at 0x24725f0>
mr_ = <numpy.ma.extras.mr_class object at 0x2479b90>
multiply = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ea70>
negative = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e440>
nomask = False
nonzero = <numpy.ma.core._frommethod instance at 0x247a518>
not_equal = <numpy.ma.core._MaskedBinaryOperation instance at 0x246eb48>
ones = <numpy.ma.core._convert2ma instance at 0x247af80>
prod = <numpy.ma.core._frommethod instance at 0x247a5a8>
product = <numpy.ma.core._frommethod instance at 0x247a638>
ravel = <numpy.ma.core._frommethod instance at 0x247a6c8>
remainder = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472440>
repeat = <numpy.ma.core._frommethod instance at 0x247a758>
row_stack = <numpy.ma.extras._fromnxfunction instance at 0x247d830>
sin = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e170>
sinh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e2d8>
soften_mask = <numpy.ma.core._frommethod instance at 0x247a7e8>
sqrt = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e5f0>
std = <numpy.ma.core._frommethod instance at 0x247a8c0>
subtract = <numpy.ma.core._MaskedBinaryOperation instance at 0x246ea28>
sum = <numpy.ma.core._frommethod instance at 0x247a950>
swapaxes = <numpy.ma.core._frommethod instance at 0x247a9e0>
take = <numpy.ma.core._frommethod instance at 0x247aa28>
tan = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e7a0>
tanh = <numpy.ma.core._MaskedUnaryOperation instance at 0x246e368>
trace = <numpy.ma.core._frommethod instance at 0x247aab8>
true_divide = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472290>
var = <numpy.ma.core._frommethod instance at 0x247aa70>
vstack = <numpy.ma.extras._fromnxfunction instance at 0x247d830>
zeros = <numpy.ma.core._convert2ma instance at 0x247d098>

 
Author
        Pierre GF Gerard-Marchant ($Author: jarrod.millman $)