numpy.ma.core
index
/usr/lib/python2.6/dist-packages/numpy/ma/core.py

numpy.ma : a package to handle missing or invalid values.
 
This package was initially written for numarray by Paul F. Dubois
at Lawrence Livermore National Laboratory. 
In 2006, the package was completely rewritten by Pierre Gerard-Marchant
(University of Georgia) to make the MaskedArray class a subclass of ndarray,
and to improve support of structured arrays.
 
 
Copyright 1999, 2000, 2001 Regents of the University of California.
Released for unlimited redistribution.
* Adapted for numpy_core 2005 by Travis Oliphant and (mainly) Paul Dubois.
* Subclassing of the base ndarray 2006 by Pierre Gerard-Marchant 
  (pgmdevlist_AT_gmail_DOT_com)
* Improvements suggested by Reggie Dugard (reggie_AT_merfinllc_DOT_com)
 
.. moduleauthor:: Pierre Gerard-Marchant

 
Modules
       
cPickle
numpy
numpy.core.numerictypes
operator
numpy.core.umath
warnings

 
Classes
       
object
MaskedIterator
_arraymethod
_extrema_operation
_maximum_operation
_minimum_operation
Exception(BaseException)
MAError
MaskError
ndarray(object)
MaskedArray
MaskedArray
_DomainCheckInterval
_DomainGreater
_DomainGreaterEqual
_DomainSafeDivide
_DomainTan
_DomainedBinaryOperation
_MaskedBinaryOperation
_MaskedPrintOption
_MaskedUnaryOperation
_convert2ma
_frommethod

 
class MAError(Exception)
    Class for MA related errors.
 
 
Method resolution order:
MAError
Exception
BaseException
object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from Exception:
__new__ = <built-in method __new__ of type object at 0x8108c0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from BaseException:
__dict__
args
message

 
class MaskError(MAError)
    Class for mask related errors.
 
 
Method resolution order:
MaskError
MAError
Exception
BaseException
object

Data descriptors inherited from MAError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from Exception:
__new__ = <built-in method __new__ of type object at 0x8108c0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from BaseException:
__dict__
args
message

 
class MaskedArray(ndarray)
    Arrays with possibly masked values.  Masked values of True
exclude the corresponding element from any computation.
 
Construction:
    x = MaskedArray(data, mask=nomask, dtype=None, copy=True,
    fill_value=None, keep_mask=True, hard_mask=False, shrink=True)
 
Parameters
----------
data : {var}
    Input data.
mask : {nomask, sequence}, optional
    Mask.  Must be convertible to an array of booleans with
    the same shape as data: True indicates a masked (eg.,
    invalid) data.
dtype : {dtype}, optional
    Data type of the output.
    If dtype is None, the type of the data argument (`data.dtype`) is used.
    If dtype is not None and different from `data.dtype`, a copy is performed.
copy : {False, True}, optional
    Whether to copy the input data (True), or to use a reference instead.
    Note: data are NOT copied by default.
subok : {True, False}, optional
    Whether to return a subclass of MaskedArray (if possible)
    or a plain MaskedArray.
ndmin : {0, int}, optional
    Minimum number of dimensions
fill_value : {var}, optional
    Value used to fill in the masked values when necessary.
    If None, a default based on the datatype is used.
keep_mask : {True, boolean}, optional
    Whether to combine mask with the mask of the input data,
    if any (True), or to use only mask for the output (False).
hard_mask : {False, boolean}, optional
    Whether to use a hard mask or not.
    With a hard mask, masked values cannot be unmasked.
shrink : {True, boolean}, optional
    Whether to force compression of an empty mask.
 
 
Method resolution order:
MaskedArray
ndarray
object

Methods defined here:
__add__(self, other)
Add other to self, and return a new masked array.
__array_finalize__(self, obj)
Finalizes the masked array.
__array_wrap__(self, obj, context=None)
Special hook for ufuncs.
Wraps the numpy array and sets the mask according to context.
__deepcopy__(self, memo=None)
__div__(self, other)
Divide other into self, and return a new masked array.
__eq__(self, other)
Check whether other equals self elementwise
__float__(self)
Convert to float.
__floordiv__(self, other)
Divide other into self, and return a new masked array.
__getitem__(self, indx)
x.__getitem__(y) <==> x[y]
 
Return the item described by i, as a masked array.
__getslice__(self, i, j)
x.__getslice__(i, j) <==> x[i:j]
 
Return the slice described by (i, j).  The use of negative
indices is not supported.
__getstate__(self)
Return the internal state of the masked array, for pickling
purposes.
__iadd__(self, other)
Add other to self in-place.
__idiv__(self, other)
Divide self by other in-place.
__imul__(self, other)
Multiply self by other in-place.
__int__(self)
Convert to int.
__ipow__(self, other)
Raise self to the power other, in place.
__isub__(self, other)
Subtract other from self in-place.
__mul__(self, other)
Multiply other by self, and return a new masked array.
__ne__(self, other)
Check whether other doesn't equal self elementwise
__pow__(self, other)
Raise self to the power other, masking the potential NaNs/Infs
__radd__(self, other)
Add other to self, and return a new masked array.
__reduce__(self)
Return a 3-tuple for pickling a MaskedArray.
__repr__(self)
Literal string representation.
__rmul__(self, other)
Multiply other by self, and return a new masked array.
__rsub__(self, other)
Subtract other to self, and return a new masked array.
__setitem__(self, indx, value)
x.__setitem__(i, y) <==> x[i]=y
 
Set item described by index. If value is masked, masks those
locations.
__setmask__(self, mask, copy=False)
Set the mask.
__setslice__(self, i, j, value)
x.__setslice__(i, j, value) <==> x[i:j]=value
 
Set the slice (i,j) of a to value. If value is masked, mask
those locations.
__setstate__(self, state)
Restore the internal state of the masked array, for
pickling purposes.  ``state`` is typically the output of the
``__getstate__`` output, and is a 5-tuple:
 
- class name
- a tuple giving the shape of the data
- a typecode for the data
- a binary string for the data
- a binary string for the mask.
__str__(self)
String representation.
__sub__(self, other)
Subtract other to self, and return a new masked array.
__truediv__(self, other)
Divide other into self, and return a new masked array.
all(self, axis=None, out=None)
Check if all of the elements of `a` are true.
 
Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
current axis are masked: if the output would have been a scalar and that
all the values are masked, then the output is `masked`.
 
Parameters
----------
axis : {None, integer}
    Axis to perform the operation over.
    If None, perform over flattened array.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
See Also
--------
all : equivalent function
 
Examples
--------
>>> np.ma.array([1,2,3]).all()
True
>>> a = np.ma.array([1,2,3], mask=True)
>>> (a.all() is np.ma.masked)
True
anom(self, axis=None, dtype=None)
Return the anomalies (deviations from the average) along the given axis.
 
Parameters
----------
axis : int, optional
    Axis along which to perform the operation.
    If None, applies to a flattened version of the array.
dtype : {dtype}, optional
    Datatype for the intermediary computation.
    If not given, the current dtype is used instead.
any(self, axis=None, out=None)
Check if any of the elements of `a` are true.
 
Performs a logical_or over the given axis and returns the result.
Masked values are considered as False during computation.
 
Parameters
----------
axis : {None, integer}
    Axis to perform the operation over.
    If None, perform over flattened array and return a scalar.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
See Also
--------
any : equivalent function
argmax(self, axis=None, fill_value=None, out=None)
Returns array of indices of the maximum values along the given axis.
Masked values are treated as if they had the value fill_value.
 
Parameters
----------
axis : {None, integer}
    If None, the index is into the flattened array, otherwise along
    the specified axis
fill_value : {var}, optional
    Value used to fill in the masked values.  If None, the output of
    maximum_fill_value(self._data) is used instead.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
Returns
-------
index_array : {integer_array}
 
Examples
--------
>>> a = np.arange(6).reshape(2,3)
>>> a.argmax()
5
>>> a.argmax(0)
array([1, 1, 1])
>>> a.argmax(1)
array([2, 2])
argmin(self, axis=None, fill_value=None, out=None)
Return array of indices to the minimum values along the given axis.
 
Parameters
----------
axis : {None, integer}
    If None, the index is into the flattened array, otherwise along
    the specified axis
fill_value : {var}, optional
    Value used to fill in the masked values.  If None, the output of
    minimum_fill_value(self._data) is used instead.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
Returns
-------
{ndarray, scalar}
    If multi-dimension input, returns a new ndarray of indices to the
    minimum values along the given axis.  Otherwise, returns a scalar
    of index to the minimum values along the given axis.
 
Examples
--------
>>> x = np.ma.array(arange(4), mask=[1,1,0,0])
>>> x.shape = (2,2)
>>> print x
[[-- --]
 [2 3]]
>>> print x.argmin(axis=0, fill_value=-1)
[0 0]
>>> print x.argmin(axis=0, fill_value=9)
[1 1]
argsort(self, axis=None, fill_value=None, kind='quicksort', order=None)
Return an ndarray of indices that sort the array along the
specified axis.  Masked values are filled beforehand to
fill_value.
 
Parameters
----------
axis : int, optional
    Axis along which to sort.  If not given, the flattened array is used.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm.
order : list, optional
    When `a` is an array with fields defined, this argument specifies
    which fields to compare first, second, etc.  Not all fields need be
    specified.
Returns
-------
index_array : ndarray, int
    Array of indices that sort `a` along the specified axis.
    In other words, ``a[index_array]`` yields a sorted `a`.
 
See Also
--------
sort : Describes sorting algorithms used.
lexsort : Indirect stable sort with multiple keys.
ndarray.sort : Inplace sort.
 
Notes
-----
See `sort` for notes on the different sorting algorithms.
astype(self, newtype)
Returns a copy of the MaskedArray cast to given newtype.
 
Returns
-------
output : MaskedArray
    A copy of self cast to input newtype.
    The returned record shape matches self.shape.
 
Examples
--------
>>> x = np.ma.array([[1,2,3.1],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1.0 -- 3.1]
 [-- 5.0 --]
 [7.0 -- 9.0]]
>>> print x.astype(int32)
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
clip(...)
a.clip(a_min, a_max, out=None)
 
Return an array whose values are limited to ``[a_min, a_max]``.
 
Refer to `numpy.clip` for full documentation.
 
See Also
--------
numpy.clip : equivalent function
compress(self, condition, axis=None, out=None)
Return `a` where condition is ``True``.
 
If condition is a `MaskedArray`, missing values are considered
as ``False``.
 
Parameters
----------
condition : var
    Boolean 1-d array selecting which entries to return. If len(condition)
    is less than the size of a along the axis, then output is truncated
    to length of condition array.
axis : {None, int}, optional
    Axis along which the operation must be performed.
out : {None, ndarray}, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type will be cast if
    necessary.
 
Returns
-------
result : MaskedArray
    A :class:`MaskedArrayobject.
 
Notes
-----
Please note the difference with :meth:`compressed` !
The output of :meth:`compress` has a mask, the output of
:meth:`compressed` does not.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> x.compress([1, 0, 1])
masked_array(data = [1 3],
      mask = [False False],
      fill_value=999999)
 
>>> x.compress([1, 0, 1], axis=1)
masked_array(data =
 [[1 3]
 [-- --]
 [7 9]],
      mask =
 [[False False]
 [ True  True]
 [False False]],
      fill_value=999999)
compressed(self)
Return a 1-D array of all the non-masked data.
 
Returns
-------
data : ndarray.
    A new ndarray holding the non-masked data is returned.
 
Notes
-----
+ The result is NOT a MaskedArray !
 
Examples
--------
>>> x = array(arange(5), mask=[0]+[1]*4)
>>> print x.compressed()
[0]
>>> print type(x.compressed())
<type 'numpy.ndarray'>
copy(...)
a.copy(order='C')
 
Return a copy of the array.
 
Parameters
----------
order : {'C', 'F', 'A'}, optional
    By default, the result is stored in C-contiguous (row-major) order in
    memory.  If `order` is `F`, the result has 'Fortran' (column-major)
    order.  If order is 'A' ('Any'), then the result has the same order
    as the input.
 
Examples
--------
>>> x = np.array([[1,2,3],[4,5,6]], order='F')
 
>>> y = x.copy()
 
>>> x.fill(0)
 
>>> x
array([[0, 0, 0],
       [0, 0, 0]])
 
>>> y
array([[1, 2, 3],
       [4, 5, 6]])
 
>>> y.flags['C_CONTIGUOUS']
True
count(self, axis=None)
Count the non-masked elements of the array along the given axis.
 
Parameters
----------
axis : int, optional
    Axis along which to count the non-masked elements. If axis is None,
    all the non masked elements are counted.
 
Returns
-------
result : MaskedArray
    A masked array where the mask is True where all data are
    masked.  If axis is None, returns either a scalar ot the
    masked singleton if all values are masked.
cumprod(self, axis=None, dtype=None, out=None)
Return the cumulative product of the elements along the given axis.
The cumulative product is taken over the flattened array by
default, otherwise over the specified axis.
 
Masked values are set to 1 internally during the computation.
However, their position is saved, and the result will be masked at
the same locations.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the product is computed. The default
    (`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are multiplied. If ``dtype`` has the value ``None`` and
    the type of ``a`` is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of ``a``.
out : ndarray, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Warnings
--------
The mask is lost if out is not a valid MaskedArray !
 
Returns
-------
cumprod : ndarray
    A new array holding the result is returned unless out is specified,
    in which case a reference to out is returned.
 
Notes
-----
Arithmetic is modular when using integer types, and no error is
raised on overflow.
cumsum(self, axis=None, dtype=None, out=None)
Return the cumulative sum of the elements along the given axis.
The cumulative sum is calculated over the flattened array by
default, otherwise over the specified axis.
 
Masked values are set to 0 internally during the computation.
However, their position is saved, and the result will be masked at
the same locations.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the sum is computed. The default (`axis` = None) is to
    compute over the flattened array. `axis` may be negative, in which case
    it counts from the   last to the first axis.
dtype : {None, dtype}, optional
    Type of the returned array and of the accumulator in which the
    elements are summed.  If `dtype` is not specified, it defaults
    to the dtype of `a`, unless `a` has an integer dtype with a
    precision less than that of the default platform integer.  In
    that case, the default platform integer is used.
out : ndarray, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Warnings
--------
The mask is lost if out is not a valid :class:`MaskedArray` !
 
Returns
-------
cumsum : ndarray.
    A new array holding the result is returned unless ``out`` is
    specified, in which case a reference to ``out`` is returned.
 
Examples
--------
>>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
>>> print marr.cumsum()
[0 1 3 -- -- -- 9 16 24 33]
 
 
Notes
-----
Arithmetic is modular when using integer types, and no error is
raised on overflow.
diagonal(...)
a.diagonal(offset=0, axis1=0, axis2=1)
 
Return specified diagonals.
 
Refer to `numpy.diagonal` for full documentation.
 
See Also
--------
numpy.diagonal : equivalent function
filled(self, fill_value=None)
Return a copy of self, where masked values are filled with `fill_value`.
 
If `fill_value` is None, `self.fill_value` is used instead.
 
Notes
-----
+ Subclassing is preserved
+ The result is NOT a MaskedArray !
 
Examples
--------
>>> x = np.ma.array([1,2,3,4,5], mask=[0,0,1,0,1], fill_value=-999)
>>> x.filled()
array([1,2,-999,4,-999])
>>> type(x.filled())
<type 'numpy.ndarray'>
flatten(...)
a.flatten(order='C')
 
Return a copy of the array collapsed into one dimension.
 
Parameters
----------
order : {'C', 'F'}, optional
    Whether to flatten in C (row-major) or Fortran (column-major) order.
    The default is 'C'.
 
Returns
-------
y : ndarray
    A copy of the input array, flattened to one dimension.
 
See Also
--------
ravel : Return a flattened array.
flat : A 1-D flat iterator over the array.
 
Examples
--------
>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])
get_fill_value(self)
Return the filling value.
get_imag(self)
Returns the imaginary part.
get_real(self)
Returns the real part.
harden_mask(self)
Force the mask to hard.
ids(self)
Return the addresses of the data and mask areas.
iscontiguous(self)
Is the data contiguous?
max(self, axis=None, out=None, fill_value=None)
Return the maximum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must
    be of the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of maximum_fill_value().
 
Returns
-------
amax : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
maximum_fill_value
    Returns the maximum filling value for a given datatype.
mean(self, axis=None, dtype=None, out=None)
Returns the average of the array elements along given axis.
Refer to `numpy.mean` for full documentation.
 
See Also
--------
numpy.mean : equivalent function'
min(self, axis=None, out=None, fill_value=None)
Return the minimum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must be of
    the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of `minimum_fill_value`.
 
Returns
-------
amin : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
minimum_fill_value
    Returns the minimum filling value for a given datatype.
mini(self, axis=None)
nonzero(self)
Return the indices of the elements of a that are not zero
nor masked, as a tuple of arrays.
 
There are as many tuples as dimensions of a, each tuple
contains the indices of the non-zero elements in that
dimension.  The corresponding non-zero values can be obtained
with ``a[a.nonzero()]``.
 
To group the indices by element, rather than dimension, use
instead: ``transpose(a.nonzero())``.
 
The result of this is always a 2d array, with a row for each
non-zero element.
prod(self, axis=None, dtype=None, out=None)
Return the product of the array elements over the given axis.
Masked elements are set to 1 internally for computation.
 
Parameters
----------
axis : {None, int}, optional
    Axis over which the product is taken. If None is used, then the
    product is over all the array elements.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are multiplied. If ``dtype`` has the value ``None``
    and the type of a is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of a.
out : {None, array}, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type will be cast if
    necessary.
 
Returns
-------
product_along_axis : {array, scalar}, see dtype parameter above.
    Returns an array whose shape is the same as a with the specified
    axis removed. Returns a 0d array when a is 1d or axis=None.
    Returns a reference to the specified output array if specified.
 
See Also
--------
prod : equivalent function
 
Notes
-----
Arithmetic is modular when using integer types, and no error is raised
on overflow.
 
Examples
--------
>>> np.prod([1.,2.])
2.0
>>> np.prod([1.,2.], dtype=np.int32)
2
>>> np.prod([[1.,2.],[3.,4.]])
24.0
>>> np.prod([[1.,2.],[3.,4.]], axis=1)
array([  2.,  12.])
product = prod(self, axis=None, dtype=None, out=None)
ptp(self, axis=None, out=None, fill_value=None)
Return (maximum - minimum) along the the given dimension
(i.e. peak-to-peak value).
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to find the peaks.  If None (default) the
    flattened array is used.
out : {None, array_like}, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
fill_value : {var}, optional
    Value used to fill in the masked values.
 
Returns
-------
ptp : ndarray.
    A new array holding the result, unless ``out`` was
    specified, in which case a reference to ``out`` is returned.
put(self, indices, values, mode='raise')
Set storage-indexed locations to corresponding values.
 
Sets self._data.flat[n] = values[n] for each n in indices.
If `values` is shorter than `indices` then it will repeat.
If `values` has some masked values, the initial mask is updated
in consequence, else the corresponding values are unmasked.
 
Parameters
----------
indices : 1-D array_like
    Target indices, interpreted as integers.
values : array_like
    Values to place in self._data copy at target indices.
mode : {'raise', 'wrap', 'clip'}, optional
    Specifies how out-of-bounds indices will behave.
    'raise' : raise an error.
    'wrap' : wrap around.
    'clip' : clip to the range.
 
Notes
-----
`values` can be a scalar or length 1 array.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> x.put([0,4,8],[10,20,30])
>>> print x
[[10 -- 3]
 [-- 20 --]
 [7 -- 30]]
 
>>> x.put(4,999)
>>> print x
[[10 -- 3]
 [-- 999 --]
 [7 -- 30]]
ravel(self)
Returns a 1D version of self, as a view.
 
Returns
-------
MaskedArray
    Output view is of shape ``(self.size,)`` (or
    ``(np.ma.product(self.shape),)``).
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.ravel()
[1 -- 3 -- 5 -- 7 -- 9]
raw_data(self)
Return the _data part of the MaskedArray.
 
DEPRECATED: You should really use ``.data`` instead...
repeat(...)
a.repeat(repeats, axis=None)
 
Repeat elements of an array.
 
Refer to `numpy.repeat` for full documentation.
 
See Also
--------
numpy.repeat : equivalent function
reshape(self, *s, **kwargs)
Returns a masked array containing the data of a, but with a new shape.
The result is a view to the original array; if this is not possible,
a ValueError is raised.
 
Parameters
----------
shape : shape tuple or int
   The new shape should be compatible with the original shape. If an
   integer, then the result will be a 1D array of that length.
order : {'C', 'F'}, optional
    Determines whether the array data should be viewed as in C
    (row-major) order or FORTRAN (column-major) order.
 
Returns
-------
reshaped_array : array
    A new view to the array.
 
Notes
-----
If you want to modify the shape in place, please use ``a.shape = s``
 
Examples
--------
>>> x = np.ma.array([[1,2],[3,4]], mask=[1,0,0,1])
>>> print x
[[-- 2]
 [3 --]]
>>> x = x.reshape((4,1))
>>> print x
[[--]
 [2]
 [3]
 [--]]
resize(self, newshape, refcheck=True, order=False)
Change shape and size of array in-place.
round(self, decimals=0, out=None)
a.round(decimals=0, out=None)
 
Return an array rounded a to the given number of decimals.
 
Refer to `numpy.around` for full documentation.
 
See Also
--------
numpy.around : equivalent function
set_fill_value(self, value=None)
Set the filling value to value.
 
If value is None, use a default based on the data type.
shrink_mask(self)
Reduce a mask to nomask when possible.
soften_mask(self)
Force the mask to soft.
sort(self, axis=-1, kind='quicksort', order=None, endwith=True, fill_value=None)
Return a sorted copy of an array.
 
Parameters
----------
a : array_like
    Array to be sorted.
axis : int or None, optional
    Axis along which to sort. If None, the array is flattened before
    sorting. The default is -1, which sorts along the last axis.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm. Default is 'quicksort'.
order : list, optional
    When `a` is a structured array, this argument specifies which fields
    to compare first, second, and so on.  This list does not need to
    include all of the fields.
endwith : {True, False}, optional
    Whether missing values (if any) should be forced in the upper indices
    (at the end of the array) (True) or lower indices (at the beginning).
fill_value : {var}
    Value used to fill in the masked values.  If None, use
    the the output of minimum_fill_value().
 
Returns
-------
sorted_array : ndarray
    Array of the same type and shape as `a`.
 
See Also
--------
ndarray.sort : Method to sort an array in-place.
argsort : Indirect sort.
lexsort : Indirect stable sort on multiple keys.
searchsorted : Find elements in a sorted array.
 
Notes
-----
The various sorting algorithms are characterized by their average speed,
worst case performance, work space size, and whether they are stable. A
stable sort keeps items with the same key in the same relative
order. The three available algorithms have the following
properties:
 
=========== ======= ============= ============ =======
   kind      speed   worst case    work space  stable
=========== ======= ============= ============ =======
'quicksort'    1     O(n^2)            0          no
'mergesort'    2     O(n*log(n))      ~n/2        yes
'heapsort'     3     O(n*log(n))       0          no
=========== ======= ============= ============ =======
 
All the sort algorithms make temporary copies of the data when
sorting along any but the last axis.  Consequently, sorting along
the last axis is faster and uses less space than sorting along
any other axis.
 
Examples
--------
>>> a = np.array([[1,4],[3,1]])
>>> np.sort(a)                # sort along the last axis
array([[1, 4],
       [1, 3]])
>>> np.sort(a, axis=None)     # sort the flattened array
array([1, 1, 3, 4])
>>> np.sort(a, axis=0)        # sort along the first axis
array([[1, 1],
       [3, 4]])
 
Use the `order` keyword to specify a field to use when sorting a
structured array:
 
>>> dtype = [('name', 'S10'), ('height', float), ('age', int)]
>>> values = [('Arthur', 1.8, 41), ('Lancelot', 1.9, 38),
...           ('Galahad', 1.7, 38)]
>>> a = np.array(values, dtype=dtype)       # create a structured array
>>> np.sort(a, order='height')                        # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41),
       ('Lancelot', 1.8999999999999999, 38)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
 
Sort by age, then height if ages are equal:
 
>>> np.sort(a, order=['age', 'height'])               # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Lancelot', 1.8999999999999999, 38),
       ('Arthur', 1.8, 41)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
squeeze(...)
a.squeeze()
 
Remove single-dimensional entries from the shape of `a`.
 
Refer to `numpy.squeeze` for full documentation.
 
See Also
--------
numpy.squeeze : equivalent function
std(self, axis=None, dtype=None, out=None, ddof=0)
Compute the standard deviation along the specified axis.
 
Returns the standard deviation, a measure of the spread of a distribution,
of the array elements. The standard deviation is computed for the
flattened array by default, otherwise over the specified axis.
 
Parameters
----------
a : array_like
    Calculate the standard deviation of these values.
axis : int, optional
    Axis along which the standard deviation is computed. The default is
    to compute the standard deviation of the flattened array.
dtype : dtype, optional
    Type to use in computing the standard deviation. For arrays of
    integer type the default is float64, for arrays of float types it is
    the same as the array type.
out : ndarray, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type (of the calculated
    values) will be cast if necessary.
ddof : int, optional
    Means Delta Degrees of Freedom.  The divisor used in calculations
    is ``N - ddof``, where ``N`` represents the number of elements.
    By default `ddof` is zero.
 
Returns
-------
standard_deviation : {ndarray, scalar}; see dtype parameter above.
    If `out` is None, return a new array containing the standard deviation,
    otherwise return a reference to the output array.
 
See Also
--------
numpy.var : Variance
numpy.mean : Average
 
Notes
-----
The standard deviation is the square root of the average of the squared
deviations from the mean, i.e., ``std = sqrt(mean(abs(x - x.mean())**2))``.
 
The mean is normally calculated as ``x.sum() / N``, where
``N = len(x)``.  If, however, `ddof` is specified, the divisor ``N - ddof``
is used instead. In standard statistical practice, ``ddof=1`` provides an
unbiased estimator of the variance of the infinite population. ``ddof=0``
provides a maximum likelihood estimate of the variance for normally
distributed variables. The standard deviation computed in this function
is the square root of the estimated variance, so even with ``ddof=1``, it
will not be an unbiased estimate of the standard deviation per se.
 
Note that, for complex numbers, std takes the absolute
value before squaring, so that the result is always real and nonnegative.
 
Examples
--------
>>> a = np.array([[1, 2], [3, 4]])
>>> np.std(a)
1.1180339887498949
>>> np.std(a, 0)
array([ 1.,  1.])
>>> np.std(a, 1)
array([ 0.5,  0.5])
sum(self, axis=None, dtype=None, out=None)
Return the sum of the array elements over the given axis.
Masked elements are set to 0 internally.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the sum is computed. The default
    (`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are summed. If dtype has the value None and
    the type of a is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of a.
out :  {None, ndarray}, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Returns
-------
sum_along_axis : MaskedArray or scalar
    An array with the same shape as self, with the specified
    axis removed.   If self is a 0-d array, or if `axis` is None, a scalar
    is returned.  If an output array is specified, a reference to
    `out` is returned.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.sum()
25
>>> print x.sum(axis=1)
[4 5 16]
>>> print x.sum(axis=0)
[8 5 12]
>>> print type(x.sum(axis=0, dtype=np.int64)[0])
<type 'numpy.int64'>
swapaxes(...)
a.swapaxes(axis1, axis2)
 
Return a view of the array with `axis1` and `axis2` interchanged.
 
Refer to `numpy.swapaxes` for full documentation.
 
See Also
--------
numpy.swapaxes : equivalent function
take(...)
a.take(indices, axis=None, out=None, mode='raise')
 
Return an array formed from the elements of a at the given indices.
 
Refer to `numpy.take` for full documentation.
 
See Also
--------
numpy.take : equivalent function
tofile(self, fid, sep='', format='%s')
#........................
toflex(self)
Transforms a MaskedArray into a flexible-type array with two fields:
 
* the ``_data`` field stores the ``_data`` part of the array;
* the ``_mask`` field stores the ``_mask`` part of the array;
 
Returns
-------
record : ndarray
    A new flexible-type ndarray with two fields: the first element
    containing a value, the second element containing the corresponding
    mask boolean.  The returned record shape matches self.shape.
 
Notes
-----
A side-effect of transforming a masked array into a flexible ndarray is
that meta information (``fill_value``, ...) will be lost.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.toflex()
[[(1, False) (2, True) (3, False)]
 [(4, True) (5, False) (6, True)]
 [(7, False) (8, True) (9, False)]]
tolist(self, fill_value=None)
Copy the data portion of the array to a hierarchical python
list and returns that list.
 
Data items are converted to the nearest compatible Python
type.  Masked values are converted to fill_value. If
fill_value is None, the corresponding entries in the output
list will be ``None``.
torecords = toflex(self)
tostring(self, fill_value=None, order='C')
Return a copy of array data as a Python string containing the raw bytes
in the array.  The array is filled beforehand.
 
Parameters
----------
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, uses self.fill_value instead.
order : {string}
    Order of the data item in the copy {'C','F','A'}.
    'C'       -- C order (row major)
    'Fortran' -- Fortran order (column major)
    'Any'     -- Current order of array.
    None      -- Same as "Any"
 
Notes
-----
As for method:`ndarray.tostring`, information about the shape, dtype...,
but also fill_value will be lost.
trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None)
a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
 
Return the sum along diagonals of the array.
 
Refer to `numpy.trace` for full documentation.
 
See Also
--------
numpy.trace : equivalent function
transpose(...)
a.transpose(*axes)
 
Returns a view of 'a' with axes transposed. If no axes are given,
or None is passed, switches the order of the axes. For a 2-d
array, this is the usual matrix transpose. If axes are given,
they describe how the axes are permuted.
 
See Also
--------
ndarray.T : array property returning the array transposed
 
 
Examples
--------
>>> a = np.array([[1,2],[3,4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose()
array([[1, 3],
       [2, 4]])
>>> a.transpose((1,0))
array([[1, 3],
       [2, 4]])
>>> a.transpose(1,0)
array([[1, 3],
       [2, 4]])
unshare_mask(self)
Copy the mask and set the sharedmask flag to False.
var(self, axis=None, dtype=None, out=None, ddof=0)
Compute the variance along the specified axis.
 
Returns the variance of the array elements, a measure of the spread of a
distribution. The variance is computed for the flattened array by default,
otherwise over the specified axis.
 
Parameters
----------
a : array_like
    Array containing numbers whose variance is desired. If `a` is not an
    array, a conversion is attempted.
axis : int, optional
    Axis along which the variance is computed. The default is to compute
    the variance of the flattened array.
dtype : dtype, optional
    Type to use in computing the variance. For arrays of integer type
    the default is float32; for arrays of float types it is the same as
    the array type.
out : ndarray, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type is cast if
    necessary.
ddof : int, optional
    "Delta Degrees of Freedom": the divisor used in calculation is
    ``N - ddof``, where ``N`` represents the number of elements. By
    default `ddof` is zero.
 
Returns
-------
variance : ndarray, see dtype parameter above
    If out=None, returns a new array containing the variance; otherwise
    a reference to the output array is returned.
 
See Also
--------
std : Standard deviation
mean : Average
 
Notes
-----
The variance is the average of the squared deviations from the mean,
i.e.,  ``var = mean(abs(x - x.mean())**2)``.
 
The mean is normally calculated as ``x.sum() / N``, where ``N = len(x)``.
If, however, `ddof` is specified, the divisor ``N - ddof`` is used
instead. In standard statistical practice, ``ddof=1`` provides an
unbiased estimator of the variance of the infinite population. ``ddof=0``
provides a maximum likelihood estimate of the variance for normally
distributed variables.
 
Note that for complex numbers, the absolute value is taken before
squaring, so that the result is always real and nonnegative.
 
Examples
--------
>>> a = np.array([[1,2],[3,4]])
>>> np.var(a)
1.25
>>> np.var(a,0)
array([ 1.,  1.])
>>> np.var(a,1)
array([ 0.25,  0.25])
view(self, dtype=None, type=None)
a.view(dtype=None, type=None)
 
New view of array with the same data.
 
Parameters
----------
dtype : data-type
    Data-type descriptor of the returned view, e.g. float32 or int16.
type : python type
    Type of the returned view, e.g. ndarray or matrix.
 
Examples
--------
>>> x = np.array([(1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
 
Viewing array data using a different type and dtype:
 
>>> y = x.view(dtype=np.int16, type=np.matrix)
>>> print y.dtype
int16
 
>>> print type(y)
<class 'numpy.core.defmatrix.matrix'>
 
Using a view to convert an array to a record array:
 
>>> z = x.view(np.recarray)
>>> z.a
array([1], dtype=int8)
 
Views share data:
 
>>> x[0] = (9, 10)
>>> z[0]
(9, 10)

Static methods defined here:
__new__(cls, data=None, mask=False, dtype=None, copy=False, subok=True, ndmin=0, fill_value=None, keep_mask=True, hard_mask=None, flag=None, shrink=True, **options)
Create a new masked array from scratch.
 
Notes
-----
A masked array can also be created by taking a .view(MaskedArray).

Data descriptors defined here:
T
__dict__
dictionary for instance variables (if defined)
baseclass
Class of the underlying data (read-only).
data
Return the current data, as a view of the original
underlying data.
fill_value
Filling value.
flat
Flat version of the array.
hardmask
Hardness of the mask
imag
Imaginary part.
mask
Mask
real
Real part
recordmask
Return the mask of the records.
A record is masked when all the fields are masked.
sharedmask
Share status of the mask (read-only).

Data and other attributes defined here:
__array_priority__ = 15

Methods inherited from ndarray:
__abs__(...)
x.__abs__() <==> abs(x)
__and__(...)
x.__and__(y) <==> x&y
__array__(...)
a.__array__(|dtype) -> reference if type unchanged, copy otherwise.
 
Returns either a new reference to self if dtype is not given or a new array
of provided data type if dtype is different from the current dtype of the
array.
__contains__(...)
x.__contains__(y) <==> y in x
__copy__(...)
a.__copy__([order])
 
Return a copy of the array.
 
Parameters
----------
order : {'C', 'F', 'A'}, optional
    If order is 'C' (False) then the result is contiguous (default).
    If order is 'Fortran' (True) then the result has fortran order.
    If order is 'Any' (None) then the result has fortran order
    only if the array already is in fortran order.
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__divmod__(...)
x.__divmod__(y) <==> divmod(x, y)
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__hex__(...)
x.__hex__() <==> hex(x)
__iand__(...)
x.__iand__(y) <==> x&y
__ifloordiv__(...)
x.__ifloordiv__(y) <==> x//y
__ilshift__(...)
x.__ilshift__(y) <==> x<<y
__imod__(...)
x.__imod__(y) <==> x%y
__index__(...)
x[y:z] <==> x[y.__index__():z.__index__()]
__invert__(...)
x.__invert__() <==> ~x
__ior__(...)
x.__ior__(y) <==> x|y
__irshift__(...)
x.__irshift__(y) <==> x>>y
__iter__(...)
x.__iter__() <==> iter(x)
__itruediv__(...)
x.__itruediv__(y) <==> x/y
__ixor__(...)
x.__ixor__(y) <==> x^y
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__long__(...)
x.__long__() <==> long(x)
__lshift__(...)
x.__lshift__(y) <==> x<<y
__lt__(...)
x.__lt__(y) <==> x<y
__mod__(...)
x.__mod__(y) <==> x%y
__neg__(...)
x.__neg__() <==> -x
__nonzero__(...)
x.__nonzero__() <==> x != 0
__oct__(...)
x.__oct__() <==> oct(x)
__or__(...)
x.__or__(y) <==> x|y
__pos__(...)
x.__pos__() <==> +x
__rand__(...)
x.__rand__(y) <==> y&x
__rdiv__(...)
x.__rdiv__(y) <==> y/x
__rdivmod__(...)
x.__rdivmod__(y) <==> divmod(y, x)
__rfloordiv__(...)
x.__rfloordiv__(y) <==> y//x
__rlshift__(...)
x.__rlshift__(y) <==> y<<x
__rmod__(...)
x.__rmod__(y) <==> y%x
__ror__(...)
x.__ror__(y) <==> y|x
__rpow__(...)
y.__rpow__(x[, z]) <==> pow(x, y[, z])
__rrshift__(...)
x.__rrshift__(y) <==> y>>x
__rshift__(...)
x.__rshift__(y) <==> x>>y
__rtruediv__(...)
x.__rtruediv__(y) <==> y/x
__rxor__(...)
x.__rxor__(y) <==> y^x
__xor__(...)
x.__xor__(y) <==> x^y
byteswap(...)
a.byteswap(inplace)
 
Swap the bytes of the array elements
 
Toggle between low-endian and big-endian data representation by
returning a byteswapped array, optionally swapped in-place.
 
Parameters
----------
inplace: bool, optional
    If ``True``, swap bytes in-place, default is ``False``.
 
Returns
-------
out: ndarray
    The byteswapped array. If `inplace` is ``True``, this is
    a view to self.
 
Examples
--------
>>> A = np.array([1, 256, 8755], dtype=np.int16)
>>> map(hex, A)
['0x1', '0x100', '0x2233']
>>> A.byteswap(True)
array([  256,     1, 13090], dtype=int16)
>>> map(hex, A)
['0x100', '0x1', '0x3322']
 
Arrays of strings are not swapped
 
>>> A = np.array(['ceg', 'fac'])
>>> A.byteswap()
array(['ceg', 'fac'],
      dtype='|S3')
choose(...)
a.choose(choices, out=None, mode='raise')
 
Use an index array to construct a new array from a set of choices.
 
Refer to `numpy.choose` for full documentation.
 
See Also
--------
numpy.choose : equivalent function
conj(...)
a.conj()
 
Return an array with all complex-valued elements conjugated.
conjugate(...)
a.conjugate()
 
Return an array with all complex-valued elements conjugated.
dump(...)
a.dump(file)
 
Dump a pickle of the array to the specified file.
The array can be read back with pickle.load or numpy.load.
 
Parameters
----------
file : str
    A string naming the dump file.
dumps(...)
a.dumps()
 
Returns the pickle of the array as a string.
pickle.loads or numpy.loads will convert the string back to an array.
fill(...)
a.fill(value)
 
Fill the array with a scalar value.
 
Parameters
----------
a : ndarray
    Input array
value : scalar
    All elements of `a` will be assigned this value.
 
Examples
--------
>>> a = np.array([1, 2])
>>> a.fill(0)
>>> a
array([0, 0])
>>> a = np.empty(2)
>>> a.fill(1)
>>> a
array([ 1.,  1.])
getfield(...)
a.getfield(dtype, offset)
 
Returns a field of the given array as a certain type. A field is a view of
the array data with each itemsize determined by the given type and the
offset into the current array.
item(...)
a.item()
 
Copy the first element of array to a standard Python scalar and return
it. The array must be of size one.
itemset(...)
newbyteorder(...)
arr.newbyteorder(new_order='S')
 
Return the array with the same data viewed with a different byte order.
 
Equivalent to::
 
    arr.view(arr.dtype.newbytorder(new_order))
 
Changes are also made in all fields and sub-arrays of the array data
type.
 
 
 
Parameters
----------
new_order : string, optional
    Byte order to force; a value from the byte order specifications
    above. `new_order` codes can be any of::
 
     * 'S' - swap dtype from current to opposite endian
     * {'<', 'L'} - little endian
     * {'>', 'B'} - big endian
     * {'=', 'N'} - native order
     * {'|', 'I'} - ignore (no change to byte order)
 
    The default value ('S') results in swapping the current
    byte order. The code does a case-insensitive check on the first
    letter of `new_order` for the alternatives above.  For example,
    any of 'B' or 'b' or 'biggish' are valid to specify big-endian.
 
 
Returns
-------
new_arr : array
    New array object with the dtype reflecting given change to the
    byte order.
searchsorted(...)
a.searchsorted(v, side='left')
 
Find indices where elements of v should be inserted in a to maintain order.
 
For full documentation, see `numpy.searchsorted`
 
See Also
--------
numpy.searchsorted : equivalent function
setfield(...)
m.setfield(value, dtype, offset) -> None.
places val into field of the given array defined by the data type and offset.
setflags(...)
a.setflags(write=None, align=None, uic=None)

Data descriptors inherited from ndarray:
__array_interface__
Array protocol: Python side.
__array_struct__
Array protocol: C-struct side.
base
Base object if memory is from some other object.
 
Examples
--------
 
Base of an array owning its memory is None:
 
>>> x = np.array([1,2,3,4])
>>> x.base is None
True
 
Slicing creates a view, and the memory is shared with x:
 
>>> y = x[2:]
>>> y.base is x
True
ctypes
A ctypes interface object.
dtype
Data-type for the array.
flags
Information about the memory layout of the array.
 
Attributes
----------
C_CONTIGUOUS (C)
    The data is in a single, C-style contiguous segment.
F_CONTIGUOUS (F)
    The data is in a single, Fortran-style contiguous segment.
OWNDATA (O)
    The array owns the memory it uses or borrows it from another object.
WRITEABLE (W)
    The data area can be written to.
ALIGNED (A)
    The data and strides are aligned appropriately for the hardware.
UPDATEIFCOPY (U)
    This array is a copy of some other array. When this array is
    deallocated, the base array will be updated with the contents of
    this array.
 
FNC
    F_CONTIGUOUS and not C_CONTIGUOUS.
FORC
    F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
BEHAVED (B)
    ALIGNED and WRITEABLE.
CARRAY (CA)
    BEHAVED and C_CONTIGUOUS.
FARRAY (FA)
    BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
 
Notes
-----
The `flags` object can be also accessed dictionary-like, and using
lowercased attribute names. Short flag names are only supported in
dictionary access.
 
Only the UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by
the user, via assigning to ``flags['FLAGNAME']`` or `ndarray.setflags`.
The array flags cannot be set arbitrarily:
 
- UPDATEIFCOPY can only be set ``False``.
- ALIGNED can only be set ``True`` if the data is truly aligned.
- WRITEABLE can only be set ``True`` if the array owns its own memory
  or the ultimate owner of the memory exposes a writeable buffer
  interface or is a string.
itemsize
Length of one element in bytes.
 
Examples
--------
>>> x = np.array([1,2,3], dtype=np.float64)
>>> x.itemsize
8
>>> x = np.array([1,2,3], dtype=np.complex128)
>>> x.itemsize
16
nbytes
Number of bytes in the array.
 
Examples
--------
>>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.nbytes
480
>>> np.prod(x.shape) * x.itemsize
480
ndim
Number of array dimensions.
 
Examples
--------
 
>>> x = np.array([1,2,3])
>>> x.ndim
1
>>> y = np.zeros((2,3,4))
>>> y.ndim
3
shape
Tuple of array dimensions.
 
Examples
--------
>>> x = np.array([1,2,3,4])
>>> x.shape
(4,)
>>> y = np.zeros((4,5,6))
>>> y.shape
(4, 5, 6)
>>> y.shape = (2, 5, 2, 3, 2)
>>> y.shape
(2, 5, 2, 3, 2)
size
Number of elements in the array.
 
Examples
--------
>>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.size
30
strides
Tuple of bytes to step in each dimension.
 
The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
is::
 
    offset = sum(np.array(i) * a.strides)
 
Examples
--------
>>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
>>> x.strides
(32, 4, 224, 1344)
>>> i = np.array([3,5,2,2])
>>> offset = sum(i * x.strides)
>>> x[3,5,2,2]
813
>>> offset / x.itemsize
813

 
class MaskedIterator(object)
    Define an interator.
 
  Methods defined here:
__getitem__(self, indx)
__init__(self, ma)
__iter__(self)
__setitem__(self, index, value)
### This won't work is ravel makes a copy
next(self)
Returns the next element of the iterator.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class _DomainCheckInterval
    Define a valid interval, so that :
 
``domain_check_interval(a,b)(x) = true`` where
``x < a`` or ``x > b``.
 
  Methods defined here:
__call__(self, x)
Execute the call behavior.
__init__(self, a, b)
domain_check_interval(a,b)(x) = true where x < a or y > b

 
class _DomainGreater
    DomainGreater(v)(x) = true where x <= v
 
  Methods defined here:
__call__(self, x)
Executes the call behavior.
__init__(self, critical_value)
DomainGreater(v)(x) = true where x <= v

 
class _DomainGreaterEqual
    DomainGreaterEqual(v)(x) = true where x < v
 
  Methods defined here:
__call__(self, x)
Executes the call behavior.
__init__(self, critical_value)
DomainGreaterEqual(v)(x) = true where x < v

 
class _DomainSafeDivide
    Define a domain for safe division.
 
  Methods defined here:
__call__(self, a, b)
__init__(self, tolerance=None)

 
class _DomainTan
    Define a valid interval for the `tan` function, so that:
 
``domain_tan(eps) = True`` where ``abs(cos(x)) < eps``
 
  Methods defined here:
__call__(self, x)
Executes the call behavior.
__init__(self, eps)
domain_tan(eps) = true where abs(cos(x)) < eps)

 
class _DomainedBinaryOperation
    Define binary operations that have a domain, like divide.
 
They have no reduce, outer or accumulate.
 
Parameters
----------
f : function.
domain : Default domain.
fillx : Default filling value for the first argument (0).
filly : Default filling value for the second argument (0).
 
  Methods defined here:
__call__(self, a, b, *args, **kwargs)
Execute the call behavior.
__init__(self, dbfunc, domain, fillx=0, filly=0)
abfunc(fillx, filly) must be defined.
abfunc(x, filly) = x for all x to enable reduce.
__str__(self)

 
class _MaskedBinaryOperation
    Define masked version of binary operations, where invalid
values are pre-masked.
 
Parameters
----------
f : callable
fillx :
    Default filling value for the first argument (0).
filly :
    Default filling value for the second argument (0).
domain :
    Default domain (None).
 
  Methods defined here:
__call__(self, a, b, *args, **kwargs)
Execute the call behavior.
__init__(self, mbfunc, fillx=0, filly=0)
abfunc(fillx, filly) must be defined.
abfunc(x, filly) = x for all x to enable reduce.
__str__(self)
accumulate(self, target, axis=0)
Accumulate `target` along `axis` after filling with y fill
value.
outer(self, a, b)
Return the function applied to the outer product of a and b.
reduce(self, target, axis=0, dtype=None)
Reduce `target` along the given `axis`.

 
class _MaskedPrintOption
    Handle the string used to represent missing data in a masked array.
 
  Methods defined here:
__init__(self, display)
Create the masked_print_option object.
__repr__ = __str__(self)
__str__(self)
display(self)
Display the string to print for masked values.
enable(self, shrink=1)
Set the enabling shrink to `shrink`.
enabled(self)
Is the use of the display value enabled?
set_display(self, s)
Set the string to print for masked values.

 
class _MaskedUnaryOperation
    Defines masked version of unary operations, where invalid
values are pre-masked.
 
Parameters
----------
f : callable
fill :
    Default filling value (0).
domain :
    Default domain (None).
 
  Methods defined here:
__call__(self, a, *args, **kwargs)
Execute the call behavior.
__init__(self, mufunc, fill=0, domain=None)
_MaskedUnaryOperation(aufunc, fill=0, domain=None)
aufunc(fill) must be defined
self(x) returns aufunc(x)
with masked values where domain(x) is true or getmask(x) is true.
__str__(self)

 
class _arraymethod(object)
    Define a wrapper for basic array methods.
 
Upon call, returns a masked array, where the new _data array is
the output of the corresponding method called on the original
_data.
 
If onmask is True, the new mask is the output of the method called
on the initial mask. Otherwise, the new mask is just a reference
to the initial mask.
 
Parameters
----------
_name : String
    Name of the function to apply on data.
_onmask : bool
    Whether the mask must be processed also (True) or left
    alone (False). Default: True.
obj : Object
    The object calling the arraymethod.
 
  Methods defined here:
__call__(self, *args, **params)
__get__(self, obj, objtype=None)
__init__(self, funcname, onmask=True)
getdoc(self)
Return the doc of the function (from the doc of the method).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class _convert2ma
     Methods defined here:
__call__(self, a, *args, **params)
__init__(self, funcname)
getdoc(self)
Return the doc of the function (from the doc of the method).

 
class _extrema_operation(object)
    Generic class for maximum/minimum functions.
 
  Methods defined here:
__call__(self, a, b=None)
Executes the call behavior.
outer(self, a, b)
Return the function applied to the outer product of a and b.
reduce(self, target, axis=None)
Reduce target along the given axis.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class _frommethod
    Define functions from existing MaskedArray methods.
 
Parameters
----------
    _methodname : string
        Name of the method to transform.
 
  Methods defined here:
__call__(self, a, *args, **params)
__init__(self, methodname)
getdoc(self)
Return the doc of the function (from the doc of the method).

 
class _maximum_operation(_extrema_operation)
    Object to calculate maxima
 
 
Method resolution order:
_maximum_operation
_extrema_operation
object

Methods defined here:
__init__(self)
maximum(a, b) or maximum(a)
In one argument case returns the scalar maximum.

Methods inherited from _extrema_operation:
__call__(self, a, b=None)
Executes the call behavior.
outer(self, a, b)
Return the function applied to the outer product of a and b.
reduce(self, target, axis=None)
Reduce target along the given axis.

Data descriptors inherited from _extrema_operation:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class _minimum_operation(_extrema_operation)
    Object to calculate minima
 
 
Method resolution order:
_minimum_operation
_extrema_operation
object

Methods defined here:
__init__(self)
minimum(a, b) or minimum(a)
In one argument case, returns the scalar minimum.

Methods inherited from _extrema_operation:
__call__(self, a, b=None)
Executes the call behavior.
outer(self, a, b)
Return the function applied to the outer product of a and b.
reduce(self, target, axis=None)
Reduce target along the given axis.

Data descriptors inherited from _extrema_operation:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
masked_array = class MaskedArray(ndarray)
    Arrays with possibly masked values.  Masked values of True
exclude the corresponding element from any computation.
 
Construction:
    x = MaskedArray(data, mask=nomask, dtype=None, copy=True,
    fill_value=None, keep_mask=True, hard_mask=False, shrink=True)
 
Parameters
----------
data : {var}
    Input data.
mask : {nomask, sequence}, optional
    Mask.  Must be convertible to an array of booleans with
    the same shape as data: True indicates a masked (eg.,
    invalid) data.
dtype : {dtype}, optional
    Data type of the output.
    If dtype is None, the type of the data argument (`data.dtype`) is used.
    If dtype is not None and different from `data.dtype`, a copy is performed.
copy : {False, True}, optional
    Whether to copy the input data (True), or to use a reference instead.
    Note: data are NOT copied by default.
subok : {True, False}, optional
    Whether to return a subclass of MaskedArray (if possible)
    or a plain MaskedArray.
ndmin : {0, int}, optional
    Minimum number of dimensions
fill_value : {var}, optional
    Value used to fill in the masked values when necessary.
    If None, a default based on the datatype is used.
keep_mask : {True, boolean}, optional
    Whether to combine mask with the mask of the input data,
    if any (True), or to use only mask for the output (False).
hard_mask : {False, boolean}, optional
    Whether to use a hard mask or not.
    With a hard mask, masked values cannot be unmasked.
shrink : {True, boolean}, optional
    Whether to force compression of an empty mask.
 
 
Method resolution order:
MaskedArray
ndarray
object

Methods defined here:
__add__(self, other)
Add other to self, and return a new masked array.
__array_finalize__(self, obj)
Finalizes the masked array.
__array_wrap__(self, obj, context=None)
Special hook for ufuncs.
Wraps the numpy array and sets the mask according to context.
__deepcopy__(self, memo=None)
__div__(self, other)
Divide other into self, and return a new masked array.
__eq__(self, other)
Check whether other equals self elementwise
__float__(self)
Convert to float.
__floordiv__(self, other)
Divide other into self, and return a new masked array.
__getitem__(self, indx)
x.__getitem__(y) <==> x[y]
 
Return the item described by i, as a masked array.
__getslice__(self, i, j)
x.__getslice__(i, j) <==> x[i:j]
 
Return the slice described by (i, j).  The use of negative
indices is not supported.
__getstate__(self)
Return the internal state of the masked array, for pickling
purposes.
__iadd__(self, other)
Add other to self in-place.
__idiv__(self, other)
Divide self by other in-place.
__imul__(self, other)
Multiply self by other in-place.
__int__(self)
Convert to int.
__ipow__(self, other)
Raise self to the power other, in place.
__isub__(self, other)
Subtract other from self in-place.
__mul__(self, other)
Multiply other by self, and return a new masked array.
__ne__(self, other)
Check whether other doesn't equal self elementwise
__pow__(self, other)
Raise self to the power other, masking the potential NaNs/Infs
__radd__(self, other)
Add other to self, and return a new masked array.
__reduce__(self)
Return a 3-tuple for pickling a MaskedArray.
__repr__(self)
Literal string representation.
__rmul__(self, other)
Multiply other by self, and return a new masked array.
__rsub__(self, other)
Subtract other to self, and return a new masked array.
__setitem__(self, indx, value)
x.__setitem__(i, y) <==> x[i]=y
 
Set item described by index. If value is masked, masks those
locations.
__setmask__(self, mask, copy=False)
Set the mask.
__setslice__(self, i, j, value)
x.__setslice__(i, j, value) <==> x[i:j]=value
 
Set the slice (i,j) of a to value. If value is masked, mask
those locations.
__setstate__(self, state)
Restore the internal state of the masked array, for
pickling purposes.  ``state`` is typically the output of the
``__getstate__`` output, and is a 5-tuple:
 
- class name
- a tuple giving the shape of the data
- a typecode for the data
- a binary string for the data
- a binary string for the mask.
__str__(self)
String representation.
__sub__(self, other)
Subtract other to self, and return a new masked array.
__truediv__(self, other)
Divide other into self, and return a new masked array.
all(self, axis=None, out=None)
Check if all of the elements of `a` are true.
 
Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
current axis are masked: if the output would have been a scalar and that
all the values are masked, then the output is `masked`.
 
Parameters
----------
axis : {None, integer}
    Axis to perform the operation over.
    If None, perform over flattened array.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
See Also
--------
all : equivalent function
 
Examples
--------
>>> np.ma.array([1,2,3]).all()
True
>>> a = np.ma.array([1,2,3], mask=True)
>>> (a.all() is np.ma.masked)
True
anom(self, axis=None, dtype=None)
Return the anomalies (deviations from the average) along the given axis.
 
Parameters
----------
axis : int, optional
    Axis along which to perform the operation.
    If None, applies to a flattened version of the array.
dtype : {dtype}, optional
    Datatype for the intermediary computation.
    If not given, the current dtype is used instead.
any(self, axis=None, out=None)
Check if any of the elements of `a` are true.
 
Performs a logical_or over the given axis and returns the result.
Masked values are considered as False during computation.
 
Parameters
----------
axis : {None, integer}
    Axis to perform the operation over.
    If None, perform over flattened array and return a scalar.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
See Also
--------
any : equivalent function
argmax(self, axis=None, fill_value=None, out=None)
Returns array of indices of the maximum values along the given axis.
Masked values are treated as if they had the value fill_value.
 
Parameters
----------
axis : {None, integer}
    If None, the index is into the flattened array, otherwise along
    the specified axis
fill_value : {var}, optional
    Value used to fill in the masked values.  If None, the output of
    maximum_fill_value(self._data) is used instead.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
Returns
-------
index_array : {integer_array}
 
Examples
--------
>>> a = np.arange(6).reshape(2,3)
>>> a.argmax()
5
>>> a.argmax(0)
array([1, 1, 1])
>>> a.argmax(1)
array([2, 2])
argmin(self, axis=None, fill_value=None, out=None)
Return array of indices to the minimum values along the given axis.
 
Parameters
----------
axis : {None, integer}
    If None, the index is into the flattened array, otherwise along
    the specified axis
fill_value : {var}, optional
    Value used to fill in the masked values.  If None, the output of
    minimum_fill_value(self._data) is used instead.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
Returns
-------
{ndarray, scalar}
    If multi-dimension input, returns a new ndarray of indices to the
    minimum values along the given axis.  Otherwise, returns a scalar
    of index to the minimum values along the given axis.
 
Examples
--------
>>> x = np.ma.array(arange(4), mask=[1,1,0,0])
>>> x.shape = (2,2)
>>> print x
[[-- --]
 [2 3]]
>>> print x.argmin(axis=0, fill_value=-1)
[0 0]
>>> print x.argmin(axis=0, fill_value=9)
[1 1]
argsort(self, axis=None, fill_value=None, kind='quicksort', order=None)
Return an ndarray of indices that sort the array along the
specified axis.  Masked values are filled beforehand to
fill_value.
 
Parameters
----------
axis : int, optional
    Axis along which to sort.  If not given, the flattened array is used.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm.
order : list, optional
    When `a` is an array with fields defined, this argument specifies
    which fields to compare first, second, etc.  Not all fields need be
    specified.
Returns
-------
index_array : ndarray, int
    Array of indices that sort `a` along the specified axis.
    In other words, ``a[index_array]`` yields a sorted `a`.
 
See Also
--------
sort : Describes sorting algorithms used.
lexsort : Indirect stable sort with multiple keys.
ndarray.sort : Inplace sort.
 
Notes
-----
See `sort` for notes on the different sorting algorithms.
astype(self, newtype)
Returns a copy of the MaskedArray cast to given newtype.
 
Returns
-------
output : MaskedArray
    A copy of self cast to input newtype.
    The returned record shape matches self.shape.
 
Examples
--------
>>> x = np.ma.array([[1,2,3.1],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1.0 -- 3.1]
 [-- 5.0 --]
 [7.0 -- 9.0]]
>>> print x.astype(int32)
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
clip(...)
a.clip(a_min, a_max, out=None)
 
Return an array whose values are limited to ``[a_min, a_max]``.
 
Refer to `numpy.clip` for full documentation.
 
See Also
--------
numpy.clip : equivalent function
compress(self, condition, axis=None, out=None)
Return `a` where condition is ``True``.
 
If condition is a `MaskedArray`, missing values are considered
as ``False``.
 
Parameters
----------
condition : var
    Boolean 1-d array selecting which entries to return. If len(condition)
    is less than the size of a along the axis, then output is truncated
    to length of condition array.
axis : {None, int}, optional
    Axis along which the operation must be performed.
out : {None, ndarray}, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type will be cast if
    necessary.
 
Returns
-------
result : MaskedArray
    A :class:`MaskedArrayobject.
 
Notes
-----
Please note the difference with :meth:`compressed` !
The output of :meth:`compress` has a mask, the output of
:meth:`compressed` does not.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> x.compress([1, 0, 1])
masked_array(data = [1 3],
      mask = [False False],
      fill_value=999999)
 
>>> x.compress([1, 0, 1], axis=1)
masked_array(data =
 [[1 3]
 [-- --]
 [7 9]],
      mask =
 [[False False]
 [ True  True]
 [False False]],
      fill_value=999999)
compressed(self)
Return a 1-D array of all the non-masked data.
 
Returns
-------
data : ndarray.
    A new ndarray holding the non-masked data is returned.
 
Notes
-----
+ The result is NOT a MaskedArray !
 
Examples
--------
>>> x = array(arange(5), mask=[0]+[1]*4)
>>> print x.compressed()
[0]
>>> print type(x.compressed())
<type 'numpy.ndarray'>
copy(...)
a.copy(order='C')
 
Return a copy of the array.
 
Parameters
----------
order : {'C', 'F', 'A'}, optional
    By default, the result is stored in C-contiguous (row-major) order in
    memory.  If `order` is `F`, the result has 'Fortran' (column-major)
    order.  If order is 'A' ('Any'), then the result has the same order
    as the input.
 
Examples
--------
>>> x = np.array([[1,2,3],[4,5,6]], order='F')
 
>>> y = x.copy()
 
>>> x.fill(0)
 
>>> x
array([[0, 0, 0],
       [0, 0, 0]])
 
>>> y
array([[1, 2, 3],
       [4, 5, 6]])
 
>>> y.flags['C_CONTIGUOUS']
True
count(self, axis=None)
Count the non-masked elements of the array along the given axis.
 
Parameters
----------
axis : int, optional
    Axis along which to count the non-masked elements. If axis is None,
    all the non masked elements are counted.
 
Returns
-------
result : MaskedArray
    A masked array where the mask is True where all data are
    masked.  If axis is None, returns either a scalar ot the
    masked singleton if all values are masked.
cumprod(self, axis=None, dtype=None, out=None)
Return the cumulative product of the elements along the given axis.
The cumulative product is taken over the flattened array by
default, otherwise over the specified axis.
 
Masked values are set to 1 internally during the computation.
However, their position is saved, and the result will be masked at
the same locations.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the product is computed. The default
    (`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are multiplied. If ``dtype`` has the value ``None`` and
    the type of ``a`` is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of ``a``.
out : ndarray, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Warnings
--------
The mask is lost if out is not a valid MaskedArray !
 
Returns
-------
cumprod : ndarray
    A new array holding the result is returned unless out is specified,
    in which case a reference to out is returned.
 
Notes
-----
Arithmetic is modular when using integer types, and no error is
raised on overflow.
cumsum(self, axis=None, dtype=None, out=None)
Return the cumulative sum of the elements along the given axis.
The cumulative sum is calculated over the flattened array by
default, otherwise over the specified axis.
 
Masked values are set to 0 internally during the computation.
However, their position is saved, and the result will be masked at
the same locations.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the sum is computed. The default (`axis` = None) is to
    compute over the flattened array. `axis` may be negative, in which case
    it counts from the   last to the first axis.
dtype : {None, dtype}, optional
    Type of the returned array and of the accumulator in which the
    elements are summed.  If `dtype` is not specified, it defaults
    to the dtype of `a`, unless `a` has an integer dtype with a
    precision less than that of the default platform integer.  In
    that case, the default platform integer is used.
out : ndarray, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Warnings
--------
The mask is lost if out is not a valid :class:`MaskedArray` !
 
Returns
-------
cumsum : ndarray.
    A new array holding the result is returned unless ``out`` is
    specified, in which case a reference to ``out`` is returned.
 
Examples
--------
>>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
>>> print marr.cumsum()
[0 1 3 -- -- -- 9 16 24 33]
 
 
Notes
-----
Arithmetic is modular when using integer types, and no error is
raised on overflow.
diagonal(...)
a.diagonal(offset=0, axis1=0, axis2=1)
 
Return specified diagonals.
 
Refer to `numpy.diagonal` for full documentation.
 
See Also
--------
numpy.diagonal : equivalent function
filled(self, fill_value=None)
Return a copy of self, where masked values are filled with `fill_value`.
 
If `fill_value` is None, `self.fill_value` is used instead.
 
Notes
-----
+ Subclassing is preserved
+ The result is NOT a MaskedArray !
 
Examples
--------
>>> x = np.ma.array([1,2,3,4,5], mask=[0,0,1,0,1], fill_value=-999)
>>> x.filled()
array([1,2,-999,4,-999])
>>> type(x.filled())
<type 'numpy.ndarray'>
flatten(...)
a.flatten(order='C')
 
Return a copy of the array collapsed into one dimension.
 
Parameters
----------
order : {'C', 'F'}, optional
    Whether to flatten in C (row-major) or Fortran (column-major) order.
    The default is 'C'.
 
Returns
-------
y : ndarray
    A copy of the input array, flattened to one dimension.
 
See Also
--------
ravel : Return a flattened array.
flat : A 1-D flat iterator over the array.
 
Examples
--------
>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])
get_fill_value(self)
Return the filling value.
get_imag(self)
Returns the imaginary part.
get_real(self)
Returns the real part.
harden_mask(self)
Force the mask to hard.
ids(self)
Return the addresses of the data and mask areas.
iscontiguous(self)
Is the data contiguous?
max(self, axis=None, out=None, fill_value=None)
Return the maximum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must
    be of the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of maximum_fill_value().
 
Returns
-------
amax : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
maximum_fill_value
    Returns the maximum filling value for a given datatype.
mean(self, axis=None, dtype=None, out=None)
Returns the average of the array elements along given axis.
Refer to `numpy.mean` for full documentation.
 
See Also
--------
numpy.mean : equivalent function'
min(self, axis=None, out=None, fill_value=None)
Return the minimum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must be of
    the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of `minimum_fill_value`.
 
Returns
-------
amin : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
minimum_fill_value
    Returns the minimum filling value for a given datatype.
mini(self, axis=None)
nonzero(self)
Return the indices of the elements of a that are not zero
nor masked, as a tuple of arrays.
 
There are as many tuples as dimensions of a, each tuple
contains the indices of the non-zero elements in that
dimension.  The corresponding non-zero values can be obtained
with ``a[a.nonzero()]``.
 
To group the indices by element, rather than dimension, use
instead: ``transpose(a.nonzero())``.
 
The result of this is always a 2d array, with a row for each
non-zero element.
prod(self, axis=None, dtype=None, out=None)
Return the product of the array elements over the given axis.
Masked elements are set to 1 internally for computation.
 
Parameters
----------
axis : {None, int}, optional
    Axis over which the product is taken. If None is used, then the
    product is over all the array elements.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are multiplied. If ``dtype`` has the value ``None``
    and the type of a is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of a.
out : {None, array}, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type will be cast if
    necessary.
 
Returns
-------
product_along_axis : {array, scalar}, see dtype parameter above.
    Returns an array whose shape is the same as a with the specified
    axis removed. Returns a 0d array when a is 1d or axis=None.
    Returns a reference to the specified output array if specified.
 
See Also
--------
prod : equivalent function
 
Notes
-----
Arithmetic is modular when using integer types, and no error is raised
on overflow.
 
Examples
--------
>>> np.prod([1.,2.])
2.0
>>> np.prod([1.,2.], dtype=np.int32)
2
>>> np.prod([[1.,2.],[3.,4.]])
24.0
>>> np.prod([[1.,2.],[3.,4.]], axis=1)
array([  2.,  12.])
product = prod(self, axis=None, dtype=None, out=None)
ptp(self, axis=None, out=None, fill_value=None)
Return (maximum - minimum) along the the given dimension
(i.e. peak-to-peak value).
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to find the peaks.  If None (default) the
    flattened array is used.
out : {None, array_like}, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
fill_value : {var}, optional
    Value used to fill in the masked values.
 
Returns
-------
ptp : ndarray.
    A new array holding the result, unless ``out`` was
    specified, in which case a reference to ``out`` is returned.
put(self, indices, values, mode='raise')
Set storage-indexed locations to corresponding values.
 
Sets self._data.flat[n] = values[n] for each n in indices.
If `values` is shorter than `indices` then it will repeat.
If `values` has some masked values, the initial mask is updated
in consequence, else the corresponding values are unmasked.
 
Parameters
----------
indices : 1-D array_like
    Target indices, interpreted as integers.
values : array_like
    Values to place in self._data copy at target indices.
mode : {'raise', 'wrap', 'clip'}, optional
    Specifies how out-of-bounds indices will behave.
    'raise' : raise an error.
    'wrap' : wrap around.
    'clip' : clip to the range.
 
Notes
-----
`values` can be a scalar or length 1 array.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> x.put([0,4,8],[10,20,30])
>>> print x
[[10 -- 3]
 [-- 20 --]
 [7 -- 30]]
 
>>> x.put(4,999)
>>> print x
[[10 -- 3]
 [-- 999 --]
 [7 -- 30]]
ravel(self)
Returns a 1D version of self, as a view.
 
Returns
-------
MaskedArray
    Output view is of shape ``(self.size,)`` (or
    ``(np.ma.product(self.shape),)``).
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.ravel()
[1 -- 3 -- 5 -- 7 -- 9]
raw_data(self)
Return the _data part of the MaskedArray.
 
DEPRECATED: You should really use ``.data`` instead...
repeat(...)
a.repeat(repeats, axis=None)
 
Repeat elements of an array.
 
Refer to `numpy.repeat` for full documentation.
 
See Also
--------
numpy.repeat : equivalent function
reshape(self, *s, **kwargs)
Returns a masked array containing the data of a, but with a new shape.
The result is a view to the original array; if this is not possible,
a ValueError is raised.
 
Parameters
----------
shape : shape tuple or int
   The new shape should be compatible with the original shape. If an
   integer, then the result will be a 1D array of that length.
order : {'C', 'F'}, optional
    Determines whether the array data should be viewed as in C
    (row-major) order or FORTRAN (column-major) order.
 
Returns
-------
reshaped_array : array
    A new view to the array.
 
Notes
-----
If you want to modify the shape in place, please use ``a.shape = s``
 
Examples
--------
>>> x = np.ma.array([[1,2],[3,4]], mask=[1,0,0,1])
>>> print x
[[-- 2]
 [3 --]]
>>> x = x.reshape((4,1))
>>> print x
[[--]
 [2]
 [3]
 [--]]
resize(self, newshape, refcheck=True, order=False)
Change shape and size of array in-place.
round(self, decimals=0, out=None)
a.round(decimals=0, out=None)
 
Return an array rounded a to the given number of decimals.
 
Refer to `numpy.around` for full documentation.
 
See Also
--------
numpy.around : equivalent function
set_fill_value(self, value=None)
Set the filling value to value.
 
If value is None, use a default based on the data type.
shrink_mask(self)
Reduce a mask to nomask when possible.
soften_mask(self)
Force the mask to soft.
sort(self, axis=-1, kind='quicksort', order=None, endwith=True, fill_value=None)
Return a sorted copy of an array.
 
Parameters
----------
a : array_like
    Array to be sorted.
axis : int or None, optional
    Axis along which to sort. If None, the array is flattened before
    sorting. The default is -1, which sorts along the last axis.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm. Default is 'quicksort'.
order : list, optional
    When `a` is a structured array, this argument specifies which fields
    to compare first, second, and so on.  This list does not need to
    include all of the fields.
endwith : {True, False}, optional
    Whether missing values (if any) should be forced in the upper indices
    (at the end of the array) (True) or lower indices (at the beginning).
fill_value : {var}
    Value used to fill in the masked values.  If None, use
    the the output of minimum_fill_value().
 
Returns
-------
sorted_array : ndarray
    Array of the same type and shape as `a`.
 
See Also
--------
ndarray.sort : Method to sort an array in-place.
argsort : Indirect sort.
lexsort : Indirect stable sort on multiple keys.
searchsorted : Find elements in a sorted array.
 
Notes
-----
The various sorting algorithms are characterized by their average speed,
worst case performance, work space size, and whether they are stable. A
stable sort keeps items with the same key in the same relative
order. The three available algorithms have the following
properties:
 
=========== ======= ============= ============ =======
   kind      speed   worst case    work space  stable
=========== ======= ============= ============ =======
'quicksort'    1     O(n^2)            0          no
'mergesort'    2     O(n*log(n))      ~n/2        yes
'heapsort'     3     O(n*log(n))       0          no
=========== ======= ============= ============ =======
 
All the sort algorithms make temporary copies of the data when
sorting along any but the last axis.  Consequently, sorting along
the last axis is faster and uses less space than sorting along
any other axis.
 
Examples
--------
>>> a = np.array([[1,4],[3,1]])
>>> np.sort(a)                # sort along the last axis
array([[1, 4],
       [1, 3]])
>>> np.sort(a, axis=None)     # sort the flattened array
array([1, 1, 3, 4])
>>> np.sort(a, axis=0)        # sort along the first axis
array([[1, 1],
       [3, 4]])
 
Use the `order` keyword to specify a field to use when sorting a
structured array:
 
>>> dtype = [('name', 'S10'), ('height', float), ('age', int)]
>>> values = [('Arthur', 1.8, 41), ('Lancelot', 1.9, 38),
...           ('Galahad', 1.7, 38)]
>>> a = np.array(values, dtype=dtype)       # create a structured array
>>> np.sort(a, order='height')                        # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41),
       ('Lancelot', 1.8999999999999999, 38)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
 
Sort by age, then height if ages are equal:
 
>>> np.sort(a, order=['age', 'height'])               # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Lancelot', 1.8999999999999999, 38),
       ('Arthur', 1.8, 41)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
squeeze(...)
a.squeeze()
 
Remove single-dimensional entries from the shape of `a`.
 
Refer to `numpy.squeeze` for full documentation.
 
See Also
--------
numpy.squeeze : equivalent function
std(self, axis=None, dtype=None, out=None, ddof=0)
Compute the standard deviation along the specified axis.
 
Returns the standard deviation, a measure of the spread of a distribution,
of the array elements. The standard deviation is computed for the
flattened array by default, otherwise over the specified axis.
 
Parameters
----------
a : array_like
    Calculate the standard deviation of these values.
axis : int, optional
    Axis along which the standard deviation is computed. The default is
    to compute the standard deviation of the flattened array.
dtype : dtype, optional
    Type to use in computing the standard deviation. For arrays of
    integer type the default is float64, for arrays of float types it is
    the same as the array type.
out : ndarray, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type (of the calculated
    values) will be cast if necessary.
ddof : int, optional
    Means Delta Degrees of Freedom.  The divisor used in calculations
    is ``N - ddof``, where ``N`` represents the number of elements.
    By default `ddof` is zero.
 
Returns
-------
standard_deviation : {ndarray, scalar}; see dtype parameter above.
    If `out` is None, return a new array containing the standard deviation,
    otherwise return a reference to the output array.
 
See Also
--------
numpy.var : Variance
numpy.mean : Average
 
Notes
-----
The standard deviation is the square root of the average of the squared
deviations from the mean, i.e., ``std = sqrt(mean(abs(x - x.mean())**2))``.
 
The mean is normally calculated as ``x.sum() / N``, where
``N = len(x)``.  If, however, `ddof` is specified, the divisor ``N - ddof``
is used instead. In standard statistical practice, ``ddof=1`` provides an
unbiased estimator of the variance of the infinite population. ``ddof=0``
provides a maximum likelihood estimate of the variance for normally
distributed variables. The standard deviation computed in this function
is the square root of the estimated variance, so even with ``ddof=1``, it
will not be an unbiased estimate of the standard deviation per se.
 
Note that, for complex numbers, std takes the absolute
value before squaring, so that the result is always real and nonnegative.
 
Examples
--------
>>> a = np.array([[1, 2], [3, 4]])
>>> np.std(a)
1.1180339887498949
>>> np.std(a, 0)
array([ 1.,  1.])
>>> np.std(a, 1)
array([ 0.5,  0.5])
sum(self, axis=None, dtype=None, out=None)
Return the sum of the array elements over the given axis.
Masked elements are set to 0 internally.
 
Parameters
----------
axis : {None, -1, int}, optional
    Axis along which the sum is computed. The default
    (`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
    Determines the type of the returned array and of the accumulator
    where the elements are summed. If dtype has the value None and
    the type of a is an integer type of precision less than the default
    platform integer, then the default platform integer precision is
    used.  Otherwise, the dtype is the same as that of a.
out :  {None, ndarray}, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
 
Returns
-------
sum_along_axis : MaskedArray or scalar
    An array with the same shape as self, with the specified
    axis removed.   If self is a 0-d array, or if `axis` is None, a scalar
    is returned.  If an output array is specified, a reference to
    `out` is returned.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.sum()
25
>>> print x.sum(axis=1)
[4 5 16]
>>> print x.sum(axis=0)
[8 5 12]
>>> print type(x.sum(axis=0, dtype=np.int64)[0])
<type 'numpy.int64'>
swapaxes(...)
a.swapaxes(axis1, axis2)
 
Return a view of the array with `axis1` and `axis2` interchanged.
 
Refer to `numpy.swapaxes` for full documentation.
 
See Also
--------
numpy.swapaxes : equivalent function
take(...)
a.take(indices, axis=None, out=None, mode='raise')
 
Return an array formed from the elements of a at the given indices.
 
Refer to `numpy.take` for full documentation.
 
See Also
--------
numpy.take : equivalent function
tofile(self, fid, sep='', format='%s')
#........................
toflex(self)
Transforms a MaskedArray into a flexible-type array with two fields:
 
* the ``_data`` field stores the ``_data`` part of the array;
* the ``_mask`` field stores the ``_mask`` part of the array;
 
Returns
-------
record : ndarray
    A new flexible-type ndarray with two fields: the first element
    containing a value, the second element containing the corresponding
    mask boolean.  The returned record shape matches self.shape.
 
Notes
-----
A side-effect of transforming a masked array into a flexible ndarray is
that meta information (``fill_value``, ...) will be lost.
 
Examples
--------
>>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
>>> print x
[[1 -- 3]
 [-- 5 --]
 [7 -- 9]]
>>> print x.toflex()
[[(1, False) (2, True) (3, False)]
 [(4, True) (5, False) (6, True)]
 [(7, False) (8, True) (9, False)]]
tolist(self, fill_value=None)
Copy the data portion of the array to a hierarchical python
list and returns that list.
 
Data items are converted to the nearest compatible Python
type.  Masked values are converted to fill_value. If
fill_value is None, the corresponding entries in the output
list will be ``None``.
torecords = toflex(self)
tostring(self, fill_value=None, order='C')
Return a copy of array data as a Python string containing the raw bytes
in the array.  The array is filled beforehand.
 
Parameters
----------
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, uses self.fill_value instead.
order : {string}
    Order of the data item in the copy {'C','F','A'}.
    'C'       -- C order (row major)
    'Fortran' -- Fortran order (column major)
    'Any'     -- Current order of array.
    None      -- Same as "Any"
 
Notes
-----
As for method:`ndarray.tostring`, information about the shape, dtype...,
but also fill_value will be lost.
trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None)
a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
 
Return the sum along diagonals of the array.
 
Refer to `numpy.trace` for full documentation.
 
See Also
--------
numpy.trace : equivalent function
transpose(...)
a.transpose(*axes)
 
Returns a view of 'a' with axes transposed. If no axes are given,
or None is passed, switches the order of the axes. For a 2-d
array, this is the usual matrix transpose. If axes are given,
they describe how the axes are permuted.
 
See Also
--------
ndarray.T : array property returning the array transposed
 
 
Examples
--------
>>> a = np.array([[1,2],[3,4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose()
array([[1, 3],
       [2, 4]])
>>> a.transpose((1,0))
array([[1, 3],
       [2, 4]])
>>> a.transpose(1,0)
array([[1, 3],
       [2, 4]])
unshare_mask(self)
Copy the mask and set the sharedmask flag to False.
var(self, axis=None, dtype=None, out=None, ddof=0)
Compute the variance along the specified axis.
 
Returns the variance of the array elements, a measure of the spread of a
distribution. The variance is computed for the flattened array by default,
otherwise over the specified axis.
 
Parameters
----------
a : array_like
    Array containing numbers whose variance is desired. If `a` is not an
    array, a conversion is attempted.
axis : int, optional
    Axis along which the variance is computed. The default is to compute
    the variance of the flattened array.
dtype : dtype, optional
    Type to use in computing the variance. For arrays of integer type
    the default is float32; for arrays of float types it is the same as
    the array type.
out : ndarray, optional
    Alternative output array in which to place the result. It must have
    the same shape as the expected output but the type is cast if
    necessary.
ddof : int, optional
    "Delta Degrees of Freedom": the divisor used in calculation is
    ``N - ddof``, where ``N`` represents the number of elements. By
    default `ddof` is zero.
 
Returns
-------
variance : ndarray, see dtype parameter above
    If out=None, returns a new array containing the variance; otherwise
    a reference to the output array is returned.
 
See Also
--------
std : Standard deviation
mean : Average
 
Notes
-----
The variance is the average of the squared deviations from the mean,
i.e.,  ``var = mean(abs(x - x.mean())**2)``.
 
The mean is normally calculated as ``x.sum() / N``, where ``N = len(x)``.
If, however, `ddof` is specified, the divisor ``N - ddof`` is used
instead. In standard statistical practice, ``ddof=1`` provides an
unbiased estimator of the variance of the infinite population. ``ddof=0``
provides a maximum likelihood estimate of the variance for normally
distributed variables.
 
Note that for complex numbers, the absolute value is taken before
squaring, so that the result is always real and nonnegative.
 
Examples
--------
>>> a = np.array([[1,2],[3,4]])
>>> np.var(a)
1.25
>>> np.var(a,0)
array([ 1.,  1.])
>>> np.var(a,1)
array([ 0.25,  0.25])
view(self, dtype=None, type=None)
a.view(dtype=None, type=None)
 
New view of array with the same data.
 
Parameters
----------
dtype : data-type
    Data-type descriptor of the returned view, e.g. float32 or int16.
type : python type
    Type of the returned view, e.g. ndarray or matrix.
 
Examples
--------
>>> x = np.array([(1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
 
Viewing array data using a different type and dtype:
 
>>> y = x.view(dtype=np.int16, type=np.matrix)
>>> print y.dtype
int16
 
>>> print type(y)
<class 'numpy.core.defmatrix.matrix'>
 
Using a view to convert an array to a record array:
 
>>> z = x.view(np.recarray)
>>> z.a
array([1], dtype=int8)
 
Views share data:
 
>>> x[0] = (9, 10)
>>> z[0]
(9, 10)

Static methods defined here:
__new__(cls, data=None, mask=False, dtype=None, copy=False, subok=True, ndmin=0, fill_value=None, keep_mask=True, hard_mask=None, flag=None, shrink=True, **options)
Create a new masked array from scratch.
 
Notes
-----
A masked array can also be created by taking a .view(MaskedArray).

Data descriptors defined here:
T
__dict__
dictionary for instance variables (if defined)
baseclass
Class of the underlying data (read-only).
data
Return the current data, as a view of the original
underlying data.
fill_value
Filling value.
flat
Flat version of the array.
hardmask
Hardness of the mask
imag
Imaginary part.
mask
Mask
real
Real part
recordmask
Return the mask of the records.
A record is masked when all the fields are masked.
sharedmask
Share status of the mask (read-only).

Data and other attributes defined here:
__array_priority__ = 15

Methods inherited from ndarray:
__abs__(...)
x.__abs__() <==> abs(x)
__and__(...)
x.__and__(y) <==> x&y
__array__(...)
a.__array__(|dtype) -> reference if type unchanged, copy otherwise.
 
Returns either a new reference to self if dtype is not given or a new array
of provided data type if dtype is different from the current dtype of the
array.
__contains__(...)
x.__contains__(y) <==> y in x
__copy__(...)
a.__copy__([order])
 
Return a copy of the array.
 
Parameters
----------
order : {'C', 'F', 'A'}, optional
    If order is 'C' (False) then the result is contiguous (default).
    If order is 'Fortran' (True) then the result has fortran order.
    If order is 'Any' (None) then the result has fortran order
    only if the array already is in fortran order.
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__divmod__(...)
x.__divmod__(y) <==> divmod(x, y)
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__hex__(...)
x.__hex__() <==> hex(x)
__iand__(...)
x.__iand__(y) <==> x&y
__ifloordiv__(...)
x.__ifloordiv__(y) <==> x//y
__ilshift__(...)
x.__ilshift__(y) <==> x<<y
__imod__(...)
x.__imod__(y) <==> x%y
__index__(...)
x[y:z] <==> x[y.__index__():z.__index__()]
__invert__(...)
x.__invert__() <==> ~x
__ior__(...)
x.__ior__(y) <==> x|y
__irshift__(...)
x.__irshift__(y) <==> x>>y
__iter__(...)
x.__iter__() <==> iter(x)
__itruediv__(...)
x.__itruediv__(y) <==> x/y
__ixor__(...)
x.__ixor__(y) <==> x^y
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__long__(...)
x.__long__() <==> long(x)
__lshift__(...)
x.__lshift__(y) <==> x<<y
__lt__(...)
x.__lt__(y) <==> x<y
__mod__(...)
x.__mod__(y) <==> x%y
__neg__(...)
x.__neg__() <==> -x
__nonzero__(...)
x.__nonzero__() <==> x != 0
__oct__(...)
x.__oct__() <==> oct(x)
__or__(...)
x.__or__(y) <==> x|y
__pos__(...)
x.__pos__() <==> +x
__rand__(...)
x.__rand__(y) <==> y&x
__rdiv__(...)
x.__rdiv__(y) <==> y/x
__rdivmod__(...)
x.__rdivmod__(y) <==> divmod(y, x)
__rfloordiv__(...)
x.__rfloordiv__(y) <==> y//x
__rlshift__(...)
x.__rlshift__(y) <==> y<<x
__rmod__(...)
x.__rmod__(y) <==> y%x
__ror__(...)
x.__ror__(y) <==> y|x
__rpow__(...)
y.__rpow__(x[, z]) <==> pow(x, y[, z])
__rrshift__(...)
x.__rrshift__(y) <==> y>>x
__rshift__(...)
x.__rshift__(y) <==> x>>y
__rtruediv__(...)
x.__rtruediv__(y) <==> y/x
__rxor__(...)
x.__rxor__(y) <==> y^x
__xor__(...)
x.__xor__(y) <==> x^y
byteswap(...)
a.byteswap(inplace)
 
Swap the bytes of the array elements
 
Toggle between low-endian and big-endian data representation by
returning a byteswapped array, optionally swapped in-place.
 
Parameters
----------
inplace: bool, optional
    If ``True``, swap bytes in-place, default is ``False``.
 
Returns
-------
out: ndarray
    The byteswapped array. If `inplace` is ``True``, this is
    a view to self.
 
Examples
--------
>>> A = np.array([1, 256, 8755], dtype=np.int16)
>>> map(hex, A)
['0x1', '0x100', '0x2233']
>>> A.byteswap(True)
array([  256,     1, 13090], dtype=int16)
>>> map(hex, A)
['0x100', '0x1', '0x3322']
 
Arrays of strings are not swapped
 
>>> A = np.array(['ceg', 'fac'])
>>> A.byteswap()
array(['ceg', 'fac'],
      dtype='|S3')
choose(...)
a.choose(choices, out=None, mode='raise')
 
Use an index array to construct a new array from a set of choices.
 
Refer to `numpy.choose` for full documentation.
 
See Also
--------
numpy.choose : equivalent function
conj(...)
a.conj()
 
Return an array with all complex-valued elements conjugated.
conjugate(...)
a.conjugate()
 
Return an array with all complex-valued elements conjugated.
dump(...)
a.dump(file)
 
Dump a pickle of the array to the specified file.
The array can be read back with pickle.load or numpy.load.
 
Parameters
----------
file : str
    A string naming the dump file.
dumps(...)
a.dumps()
 
Returns the pickle of the array as a string.
pickle.loads or numpy.loads will convert the string back to an array.
fill(...)
a.fill(value)
 
Fill the array with a scalar value.
 
Parameters
----------
a : ndarray
    Input array
value : scalar
    All elements of `a` will be assigned this value.
 
Examples
--------
>>> a = np.array([1, 2])
>>> a.fill(0)
>>> a
array([0, 0])
>>> a = np.empty(2)
>>> a.fill(1)
>>> a
array([ 1.,  1.])
getfield(...)
a.getfield(dtype, offset)
 
Returns a field of the given array as a certain type. A field is a view of
the array data with each itemsize determined by the given type and the
offset into the current array.
item(...)
a.item()
 
Copy the first element of array to a standard Python scalar and return
it. The array must be of size one.
itemset(...)
newbyteorder(...)
arr.newbyteorder(new_order='S')
 
Return the array with the same data viewed with a different byte order.
 
Equivalent to::
 
    arr.view(arr.dtype.newbytorder(new_order))
 
Changes are also made in all fields and sub-arrays of the array data
type.
 
 
 
Parameters
----------
new_order : string, optional
    Byte order to force; a value from the byte order specifications
    above. `new_order` codes can be any of::
 
     * 'S' - swap dtype from current to opposite endian
     * {'<', 'L'} - little endian
     * {'>', 'B'} - big endian
     * {'=', 'N'} - native order
     * {'|', 'I'} - ignore (no change to byte order)
 
    The default value ('S') results in swapping the current
    byte order. The code does a case-insensitive check on the first
    letter of `new_order` for the alternatives above.  For example,
    any of 'B' or 'b' or 'biggish' are valid to specify big-endian.
 
 
Returns
-------
new_arr : array
    New array object with the dtype reflecting given change to the
    byte order.
searchsorted(...)
a.searchsorted(v, side='left')
 
Find indices where elements of v should be inserted in a to maintain order.
 
For full documentation, see `numpy.searchsorted`
 
See Also
--------
numpy.searchsorted : equivalent function
setfield(...)
m.setfield(value, dtype, offset) -> None.
places val into field of the given array defined by the data type and offset.
setflags(...)
a.setflags(write=None, align=None, uic=None)

Data descriptors inherited from ndarray:
__array_interface__
Array protocol: Python side.
__array_struct__
Array protocol: C-struct side.
base
Base object if memory is from some other object.
 
Examples
--------
 
Base of an array owning its memory is None:
 
>>> x = np.array([1,2,3,4])
>>> x.base is None
True
 
Slicing creates a view, and the memory is shared with x:
 
>>> y = x[2:]
>>> y.base is x
True
ctypes
A ctypes interface object.
dtype
Data-type for the array.
flags
Information about the memory layout of the array.
 
Attributes
----------
C_CONTIGUOUS (C)
    The data is in a single, C-style contiguous segment.
F_CONTIGUOUS (F)
    The data is in a single, Fortran-style contiguous segment.
OWNDATA (O)
    The array owns the memory it uses or borrows it from another object.
WRITEABLE (W)
    The data area can be written to.
ALIGNED (A)
    The data and strides are aligned appropriately for the hardware.
UPDATEIFCOPY (U)
    This array is a copy of some other array. When this array is
    deallocated, the base array will be updated with the contents of
    this array.
 
FNC
    F_CONTIGUOUS and not C_CONTIGUOUS.
FORC
    F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
BEHAVED (B)
    ALIGNED and WRITEABLE.
CARRAY (CA)
    BEHAVED and C_CONTIGUOUS.
FARRAY (FA)
    BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
 
Notes
-----
The `flags` object can be also accessed dictionary-like, and using
lowercased attribute names. Short flag names are only supported in
dictionary access.
 
Only the UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by
the user, via assigning to ``flags['FLAGNAME']`` or `ndarray.setflags`.
The array flags cannot be set arbitrarily:
 
- UPDATEIFCOPY can only be set ``False``.
- ALIGNED can only be set ``True`` if the data is truly aligned.
- WRITEABLE can only be set ``True`` if the array owns its own memory
  or the ultimate owner of the memory exposes a writeable buffer
  interface or is a string.
itemsize
Length of one element in bytes.
 
Examples
--------
>>> x = np.array([1,2,3], dtype=np.float64)
>>> x.itemsize
8
>>> x = np.array([1,2,3], dtype=np.complex128)
>>> x.itemsize
16
nbytes
Number of bytes in the array.
 
Examples
--------
>>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.nbytes
480
>>> np.prod(x.shape) * x.itemsize
480
ndim
Number of array dimensions.
 
Examples
--------
 
>>> x = np.array([1,2,3])
>>> x.ndim
1
>>> y = np.zeros((2,3,4))
>>> y.ndim
3
shape
Tuple of array dimensions.
 
Examples
--------
>>> x = np.array([1,2,3,4])
>>> x.shape
(4,)
>>> y = np.zeros((4,5,6))
>>> y.shape
(4, 5, 6)
>>> y.shape = (2, 5, 2, 3, 2)
>>> y.shape
(2, 5, 2, 3, 2)
size
Number of elements in the array.
 
Examples
--------
>>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.size
30
strides
Tuple of bytes to step in each dimension.
 
The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
is::
 
    offset = sum(np.array(i) * a.strides)
 
Examples
--------
>>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
>>> x.strides
(32, 4, 224, 1344)
>>> i = np.array([3,5,2,2])
>>> offset = sum(i * x.strides)
>>> x[3,5,2,2]
813
>>> offset / x.itemsize
813

 
Functions
       
_check_fill_value(fill_value, ndtype)
Private function validating the given `fill_value` for the given dtype.
 
If fill_value is None, it is set to the default corresponding to the dtype
if this latter is standard (no fields). If the datatype is flexible (named
fields), fill_value is set to a tuple whose elements are the default fill
values corresponding to each field.
 
If fill_value is not None, its value is forced to the given dtype.
_mareconstruct(subtype, baseclass, baseshape, basetype)
Internal function that builds a new MaskedArray from the
information stored in a pickle.
_recursive_extremum_fill_value(ndtype, extremum)
_recursive_filled(a, mask, fill_value)
Recursively fill `a` with `fill_value`.
Private function
_recursive_make_descr(datatype, newtype=<type 'numpy.bool_'>)
Private function allowing recursion in make_descr.
_recursive_printoption(result, mask, printopt)
Puts printoptions in result where mask is True.
Private function allowing for recursion
_recursive_set_default_fill_value(dtypedescr)
_recursive_set_fill_value(fillvalue, dtypedescr)
allclose(a, b, masked_equal=True, rtol=1.0000000000000001e-05, atol=1e-08, fill_value=None)
Returns True if two arrays are element-wise equal within a tolerance.
 
This function is equivalent to `allclose` except that masked values
are treated as equal (default) or unequal, depending on the `masked_equal`
argument.
 
Parameters
----------
a, b : array_like
    Input arrays to compare.
masked_equal : boolean, optional
    Whether masked values in `a` and `b` are considered equal (True) or not
    (False). They are considered equal by default.
rtol : Relative tolerance
    The relative difference is equal to `rtol` * `b`.
atol : Absolute tolerance
    The absolute difference is equal to `atol`.
fill_value : boolean, optional
    *Deprecated* - Whether masked values in a or b are considered equal
    (True) or not (False).
 
Returns
-------
y : bool
    Returns True if the two arrays are equal within the given
    tolerance; False otherwise. If either array contains NaN, then
    False is returned.
 
See Also
--------
all, any
numpy.allclose : the non-masked allclose
 
Notes
-----
If the following equation is element-wise True, then allclose returns
True.
 
 absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))
 
Return True if all elements of a and b are equal subject to
given tolerances.
 
Examples
--------
>>> a = ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])
>>> a
masked_array(data = [10000000000.0 1e-07 --],
             mask = [False False  True],
       fill_value = 1e+20)
>>> b = ma.array([1e10, 1e-8, -42.0], mask=[0, 0, 1])
>>> ma.allclose(a, b)
False
>>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
>>> b = ma.array([1.00001e10, 1e-9, -42.0], mask=[0, 0, 1])
>>> ma.allclose(a, b)
True
>>> ma.allclose(a, b, masked_equal=False)
False
 
Masked values are not compared directly.
 
>>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
>>> b = ma.array([1.00001e10, 1e-9, 42.0], mask=[0, 0, 1])
>>> ma.allclose(a, b)
True
>>> ma.allclose(a, b, masked_equal=False)
False
allequal(a, b, fill_value=True)
Return True if all entries of a and b are equal, using
fill_value as a truth value where either or both are masked.
alltrue = reduce(self, target, axis=0, dtype=None) method of _MaskedBinaryOperation instance
Reduce `target` along the given `axis`.
argmax(a, axis=None, fill_value=None)
Function version of the eponymous method.
argmin(a, axis=None, fill_value=None)
Returns array of indices of the maximum values along the given axis.
Masked values are treated as if they had the value fill_value.
 
Parameters
----------
axis : {None, integer}
    If None, the index is into the flattened array, otherwise along
    the specified axis
fill_value : {var}, optional
    Value used to fill in the masked values.  If None, the output of
    maximum_fill_value(self._data) is used instead.
out : {None, array}, optional
    Array into which the result can be placed. Its type is preserved
    and it must be of the right shape to hold the output.
 
Returns
-------
index_array : {integer_array}
 
Examples
--------
>>> a = np.arange(6).reshape(2,3)
>>> a.argmax()
5
>>> a.argmax(0)
array([1, 1, 1])
>>> a.argmax(1)
array([2, 2])
argsort(a, axis=None, kind='quicksort', order=None, fill_value=None)
Return an ndarray of indices that sort the array along the
specified axis.  Masked values are filled beforehand to
fill_value.
 
Parameters
----------
axis : int, optional
    Axis along which to sort.  If not given, the flattened array is used.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm.
order : list, optional
    When `a` is an array with fields defined, this argument specifies
    which fields to compare first, second, etc.  Not all fields need be
    specified.
Returns
-------
index_array : ndarray, int
    Array of indices that sort `a` along the specified axis.
    In other words, ``a[index_array]`` yields a sorted `a`.
 
See Also
--------
sort : Describes sorting algorithms used.
lexsort : Indirect stable sort with multiple keys.
ndarray.sort : Inplace sort.
 
Notes
-----
See `sort` for notes on the different sorting algorithms.
array(data, dtype=None, copy=False, order=False, mask=False, fill_value=None, keep_mask=True, hard_mask=False, shrink=True, subok=True, ndmin=0)
Arrays with possibly masked values.  Masked values of True
exclude the corresponding element from any computation.
 
Construction:
    x = MaskedArray(data, mask=nomask, dtype=None, copy=True,
    fill_value=None, keep_mask=True, hard_mask=False, shrink=True)
 
Parameters
----------
data : {var}
    Input data.
mask : {nomask, sequence}, optional
    Mask.  Must be convertible to an array of booleans with
    the same shape as data: True indicates a masked (eg.,
    invalid) data.
dtype : {dtype}, optional
    Data type of the output.
    If dtype is None, the type of the data argument (`data.dtype`) is used.
    If dtype is not None and different from `data.dtype`, a copy is performed.
copy : {False, True}, optional
    Whether to copy the input data (True), or to use a reference instead.
    Note: data are NOT copied by default.
subok : {True, False}, optional
    Whether to return a subclass of MaskedArray (if possible)
    or a plain MaskedArray.
ndmin : {0, int}, optional
    Minimum number of dimensions
fill_value : {var}, optional
    Value used to fill in the masked values when necessary.
    If None, a default based on the datatype is used.
keep_mask : {True, boolean}, optional
    Whether to combine mask with the mask of the input data,
    if any (True), or to use only mask for the output (False).
hard_mask : {False, boolean}, optional
    Whether to use a hard mask or not.
    With a hard mask, masked values cannot be unmasked.
shrink : {True, boolean}, optional
    Whether to force compression of an empty mask.
asanyarray(a, dtype=None)
Convert the input `a` to a masked array of the given datatype.
If `a` is a subclass of MaskedArray, its class is conserved.
 
Parameters
----------
a : array_like
    Input data, in any form that can be converted to an array.  This
    includes lists, lists of tuples, tuples, tuples of tuples, tuples
    of lists and ndarrays.
dtype : data-type, optional
    By default, the data-type is inferred from the input data.
order : {'C', 'F'}, optional
    Whether to use row-major ('C') or column-major ('FORTRAN') memory
    representation.  Defaults to 'C'.
 
Returns
-------
out : ndarray
    MaskedArray interpretation of `a`.  No copy is performed if the input
    is already an ndarray.
asarray(a, dtype=None, order=None)
Convert the input `a` to a masked array of the given datatype.
 
Parameters
----------
a : array_like
    Input data, in any form that can be converted to an array.  This
    includes lists, lists of tuples, tuples, tuples of tuples, tuples
    of lists and ndarrays.
dtype : data-type, optional
    By default, the data-type is inferred from the input data.
order : {'C', 'F'}, optional
    Whether to use row-major ('C') or column-major ('FORTRAN') memory
    representation.  Defaults to 'C'.
 
Returns
-------
out : ndarray
    MaskedArray interpretation of `a`.  No copy is performed if the input
    is already an ndarray.  If `a` is a subclass of MaskedArray, a base
    class MaskedArray is returned.
choose(indices, choices, out=None, mode='raise')
choose(a, choices, out=None, mode='raise')
 
Use an index array to construct a new array from a set of choices.
 
Given an array of integers and a set of n choice arrays, this method
will create a new array that merges each of the choice arrays.  Where a
value in `a` is i, the new array will have the value that choices[i]
contains in the same place.
 
Parameters
----------
a : int array
    This array must contain integers in [0, n-1], where n is the number
    of choices.
choices : sequence of arrays
    Choice arrays. The index array and all of the choices should be
    broadcastable to the same shape.
out : array, optional
    If provided, the result will be inserted into this array. It should
    be of the appropriate shape and dtype
mode : {'raise', 'wrap', 'clip'}, optional
    Specifies how out-of-bounds indices will behave.
    'raise' : raise an error
    'wrap' : wrap around
    'clip' : clip to the range
 
Returns
-------
merged_array : array
 
See Also
--------
choose : equivalent function
common_fill_value(a, b)
Return the common filling value of a and b, if any.
If a and b have different filling values, returns None.
compressed(x)
Return a 1-D array of all the non-masked data.
 
See Also
--------
MaskedArray.compressed
    equivalent method
concatenate(arrays, axis=0)
Concatenate the arrays along the given axis.
count(a, axis=None)
Count the non-masked elements of the array along the given axis.
 
Parameters
----------
axis : int, optional
    Axis along which to count the non-masked elements. If axis is None,
    all the non masked elements are counted.
 
Returns
-------
result : MaskedArray
    A masked array where the mask is True where all data are
    masked.  If axis is None, returns either a scalar ot the
    masked singleton if all values are masked.
default_fill_value(obj)
Calculate the default fill value for the argument object.
diag(v, k=0)
Extract a diagonal or construct a diagonal array.
 
Parameters
----------
v : array_like
    If `v` is a 2-dimensional array, return a copy of
    its `k`-th diagonal. If `v` is a 1-dimensional array,
    return a 2-dimensional array with `v` on the `k`-th diagonal.
k : int, optional
    Diagonal in question.  The defaults is 0.
 
Examples
--------
>>> x = np.arange(9).reshape((3,3))
>>> x
array([[0, 1, 2],
       [3, 4, 5],
       [6, 7, 8]])
>>> np.diag(x)
array([0, 4, 8])
>>> np.diag(np.diag(x))
array([[0, 0, 0],
       [0, 4, 0],
       [0, 0, 8]])
doc_note(initialdoc, note)
Adds a Notes section to an existing docstring.
dump(a, F)
Pickle the MaskedArray `a` to the file `F`.  `F` can either be
the handle of an exiting file, or a string representing a file
name.
dumps(a)
Return a string corresponding to the pickling of the MaskedArray.
expand_dims(x, axis)
Expand the shape of the array by including a new axis before
the given one.
filled(a, fill_value=None)
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
----------
a : maskedarray or array_like
    An input object.
fill_value : {var}, optional
    Filling value. If None, the output of :func:`get_fill_value(a)` is used
    instead.
 
Returns
-------
a : array_like
fix_invalid(a, mask=False, copy=True, fill_value=None)
Return (a copy of) `a` where invalid data (nan/inf) are masked
and replaced by `fill_value`.
 
Note that a copy is performed by default (just in case...).
 
Parameters
----------
a : array_like
    A (subclass of) ndarray.
copy : bool
    Whether to use a copy of `a` (True) or to fix `a` in place (False).
fill_value : {var}, optional
    Value used for fixing invalid data.  If not given, the output
    of get_fill_value(a) is used instead.
 
Returns
-------
b : MaskedArray
flatten_mask(mask)
Returns a completely flattened version of the mask, where nested fields
are collapsed.
 
Parameters
----------
mask : array_like
    Array of booleans
 
Returns
-------
flattened_mask : ndarray
    Boolean array.
 
Examples
--------
>>> mask = np.array([0, 0, 1], dtype=np.bool)
>>> flatten_mask(mask)
array([False, False,  True], dtype=bool)
>>> mask = np.array([(0, 0), (0, 1)], dtype=[('a', bool), ('b', bool)])
>>> flatten_mask(mask)
array([False, False, False,  True], dtype=bool)
>>> mdtype = [('a', bool), ('b', [('ba', bool), ('bb', bool)])]
>>> mask = np.array([(0, (0, 0)), (0, (0, 1))], dtype=mdtype)
>>> flatten_mask(mask)
array([False, False, False, False, False,  True], dtype=bool)
flatten_structured_array(a)
Flatten a strutured array.
 
The datatype of the output is the largest datatype of the (nested) fields.
 
Returns
-------
output : var
    Flatten MaskedArray if the input is a MaskedArray,
    standard ndarray otherwise.
 
Examples
--------
>>> ndtype = [('a', int), ('b', float)]
>>> a = np.array([(1, 1), (2, 2)], dtype=ndtype)
>>> flatten_structured_array(a)
array([[1., 1.],
       [2., 2.]])
fromfile(file, dtype=<type 'float'>, count=-1, sep='')
################################################################################
fromflex(fxarray)
Rebuilds a masked_array from a flexible-type array output by the '.torecord'
array
get_data = getdata(a, subok=True)
Return the data of a masked array as an ndarray.
 
Return the data of `a` (if any) as an ndarray if `a` is a ``MaskedArray``,
else return `a` as a ndarray or subclass (depending on `subok`) if not.
 
Parameters
----------
a : array_like
    Input ``MaskedArray``, alternatively a ndarray or a subclass thereof.
subok : bool
    Whether to force the output to be a `pure` ndarray (False) or to
    return a subclass of ndarray if approriate (True - default).
 
See Also
--------
getmask : Return the mask of a masked array, or nomask.
getmaskarray : Return the mask of a masked array, or full array of False.
 
Examples
--------
 
>>> import numpy.ma as ma
>>> a = ma.masked_equal([[1,2],[3,4]], 2)
>>> a
masked_array(data =
 [[1 --]
 [3 4]],
      mask =
 [[False  True]
 [False False]],
      fill_value=999999)
>>> ma.getdata(a)
array([[1, 2],
       [3, 4]])
 
Equivalently use the ``MaskedArray`` `data` attribute.
 
>>> a.data
array([[1, 2],
       [3, 4]])
get_fill_value(a)
Return the filling value of a, if any.  Otherwise, returns the
default filling value for that type.
get_mask = getmask(a)
Return the mask of a masked array, or nomask.
 
Return the mask of `a` as an ndarray if `a` is a `MaskedArray` and the
mask is not `nomask`, else return `nomask`. To guarantee a full array
of booleans of the same shape as a, use `getmaskarray`.
 
Parameters
----------
a : array_like
    Input `MaskedArray` for which the mask is required.
 
See Also
--------
getdata : Return the data of a masked array as an ndarray.
getmaskarray : Return the mask of a masked array, or full array of False.
 
Examples
--------
 
>>> import numpy.ma as ma
>>> a = ma.masked_equal([[1,2],[3,4]], 2)
>>> a
masked_array(data =
 [[1 --]
 [3 4]],
      mask =
 [[False  True]
 [False False]],
      fill_value=999999)
>>> ma.getmask(a)
array([[False,  True],
       [False, False]], dtype=bool)
 
Equivalently use the `MaskedArray` `mask` attribute.
 
>>> a.mask
array([[False,  True],
       [False, False]], dtype=bool)
 
Result when mask == `nomask`
 
>>> b = ma.masked_array([[1,2],[3,4]])
>>> b
masked_array(data =
 [[1 2]
 [3 4]],
      mask =
 False,
      fill_value=999999)
>>> ma.nomask
False
>>> ma.getmask(b) == ma.nomask
True
>>> b.mask == ma.nomask
True
get_masked_subclass(*arrays)
Return the youngest subclass of MaskedArray from a list of (masked) arrays.
In case of siblings, the first listed takes over.
get_object_signature(obj)
Get the signature from obj
getdata(a, subok=True)
Return the data of a masked array as an ndarray.
 
Return the data of `a` (if any) as an ndarray if `a` is a ``MaskedArray``,
else return `a` as a ndarray or subclass (depending on `subok`) if not.
 
Parameters
----------
a : array_like
    Input ``MaskedArray``, alternatively a ndarray or a subclass thereof.
subok : bool
    Whether to force the output to be a `pure` ndarray (False) or to
    return a subclass of ndarray if approriate (True - default).
 
See Also
--------
getmask : Return the mask of a masked array, or nomask.
getmaskarray : Return the mask of a masked array, or full array of False.
 
Examples
--------
 
>>> import numpy.ma as ma
>>> a = ma.masked_equal([[1,2],[3,4]], 2)
>>> a
masked_array(data =
 [[1 --]
 [3 4]],
      mask =
 [[False  True]
 [False False]],
      fill_value=999999)
>>> ma.getdata(a)
array([[1, 2],
       [3, 4]])
 
Equivalently use the ``MaskedArray`` `data` attribute.
 
>>> a.data
array([[1, 2],
       [3, 4]])
getmask(a)
Return the mask of a masked array, or nomask.
 
Return the mask of `a` as an ndarray if `a` is a `MaskedArray` and the
mask is not `nomask`, else return `nomask`. To guarantee a full array
of booleans of the same shape as a, use `getmaskarray`.
 
Parameters
----------
a : array_like
    Input `MaskedArray` for which the mask is required.
 
See Also
--------
getdata : Return the data of a masked array as an ndarray.
getmaskarray : Return the mask of a masked array, or full array of False.
 
Examples
--------
 
>>> import numpy.ma as ma
>>> a = ma.masked_equal([[1,2],[3,4]], 2)
>>> a
masked_array(data =
 [[1 --]
 [3 4]],
      mask =
 [[False  True]
 [False False]],
      fill_value=999999)
>>> ma.getmask(a)
array([[False,  True],
       [False, False]], dtype=bool)
 
Equivalently use the `MaskedArray` `mask` attribute.
 
>>> a.mask
array([[False,  True],
       [False, False]], dtype=bool)
 
Result when mask == `nomask`
 
>>> b = ma.masked_array([[1,2],[3,4]])
>>> b
masked_array(data =
 [[1 2]
 [3 4]],
      mask =
 False,
      fill_value=999999)
>>> ma.nomask
False
>>> ma.getmask(b) == ma.nomask
True
>>> b.mask == ma.nomask
True
getmaskarray(arr)
Return the mask of a masked array, or full boolean array of False.
 
Return the mask of `arr` as an ndarray if `arr` is a `MaskedArray` and
the mask is not `nomask`, else return a full boolean array of False of
the same shape as `arr`.
 
Parameters
----------
arr : array_like
    Input `MaskedArray` for which the mask is required.
 
See Also
--------
getmask : Return the mask of a masked array, or nomask.
getdata : Return the data of a masked array as an ndarray.
 
Examples
--------
 
>>> import numpy.ma as ma
>>> a = ma.masked_equal([[1,2],[3,4]], 2)
>>> a
masked_array(data =
 [[1 --]
 [3 4]],
      mask =
 [[False  True]
 [False False]],
      fill_value=999999)
>>> ma.getmaskarray(a)
array([[False,  True],
       [False, False]], dtype=bool)
 
Result when mask == ``nomask``
 
>>> b = ma.masked_array([[1,2],[3,4]])
>>> b
masked_array(data =
 [[1 2]
 [3 4]],
      mask =
 False,
      fill_value=999999)
>>> >ma.getmaskarray(b)
array([[False, False],
       [False, False]], dtype=bool)
inner(a, b)
inner(a, b)
 
Inner product of two arrays.
 
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes.
 
Parameters
----------
a, b : array_like
    If `a` and `b` are nonscalar, their last dimensions of must match.
 
Returns
-------
out : ndarray
    `out.shape = a.shape[:-1] + b.shape[:-1]`
 
Raises
------
ValueError
    If the last dimension of `a` and `b` has different size.
 
See Also
--------
tensordot : Sum products over arbitrary axes.
dot : Generalised matrix product, using second last dimension of `b`.
 
Notes
-----
For vectors (1-D arrays) it computes the ordinary inner-product::
 
    np.inner(a, b) = sum(a[:]*b[:])
 
More generally, if `ndim(a) = r > 0` and `ndim(b) = s > 0`::
 
    np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
 
or explicitly::
 
    np.inner(a, b)[i0,...,ir-1,j0,...,js-1]
         = sum(a[i0,...,ir-1,:]*b[j0,...,js-1,:])
 
In addition `a` or `b` may be scalars, in which case::
 
   np.inner(a,b) = a*b
 
Examples
--------
Ordinary inner product for vectors:
 
>>> a = np.array([1,2,3])
>>> b = np.array([0,1,0])
>>> np.inner(a, b)
2
 
A multidimensional example:
 
>>> a = np.arange(24).reshape((2,3,4))
>>> b = np.arange(4)
>>> np.inner(a, b)
array([[ 14,  38,  62],
       [ 86, 110, 134]])
 
An example where `b` is a scalar:
 
>>> np.inner(np.eye(2), 7)
array([[ 7.,  0.],
       [ 0.,  7.]])
 
Notes
-----
Masked values are replaced by 0.
innerproduct = inner(a, b)
inner(a, b)
 
Inner product of two arrays.
 
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes.
 
Parameters
----------
a, b : array_like
    If `a` and `b` are nonscalar, their last dimensions of must match.
 
Returns
-------
out : ndarray
    `out.shape = a.shape[:-1] + b.shape[:-1]`
 
Raises
------
ValueError
    If the last dimension of `a` and `b` has different size.
 
See Also
--------
tensordot : Sum products over arbitrary axes.
dot : Generalised matrix product, using second last dimension of `b`.
 
Notes
-----
For vectors (1-D arrays) it computes the ordinary inner-product::
 
    np.inner(a, b) = sum(a[:]*b[:])
 
More generally, if `ndim(a) = r > 0` and `ndim(b) = s > 0`::
 
    np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
 
or explicitly::
 
    np.inner(a, b)[i0,...,ir-1,j0,...,js-1]
         = sum(a[i0,...,ir-1,:]*b[j0,...,js-1,:])
 
In addition `a` or `b` may be scalars, in which case::
 
   np.inner(a,b) = a*b
 
Examples
--------
Ordinary inner product for vectors:
 
>>> a = np.array([1,2,3])
>>> b = np.array([0,1,0])
>>> np.inner(a, b)
2
 
A multidimensional example:
 
>>> a = np.arange(24).reshape((2,3,4))
>>> b = np.arange(4)
>>> np.inner(a, b)
array([[ 14,  38,  62],
       [ 86, 110, 134]])
 
An example where `b` is a scalar:
 
>>> np.inner(np.eye(2), 7)
array([[ 7.,  0.],
       [ 0.,  7.]])
 
Notes
-----
Masked values are replaced by 0.
isMA = isMaskedArray(x)
Test whether input is an instance of MaskedArray.
 
This function returns True if `x` is an instance of MaskedArray
and returns False otherwise.  Any object is accepted as input.
 
Parameters
----------
x : object
    Object to test.
 
Returns
-------
result : bool
    True if `x` is a MaskedArray.
 
See Also
--------
isMA : Alias to isMaskedArray.
isarray : Alias to isMaskedArray.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(data =
 [[1.0 -- --]
 [-- 1.0 --]
 [-- -- 1.0]],
      mask =
 [[False  True  True]
 [ True False  True]
 [ True  True False]],
      fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
isMaskedArray(x)
Test whether input is an instance of MaskedArray.
 
This function returns True if `x` is an instance of MaskedArray
and returns False otherwise.  Any object is accepted as input.
 
Parameters
----------
x : object
    Object to test.
 
Returns
-------
result : bool
    True if `x` is a MaskedArray.
 
See Also
--------
isMA : Alias to isMaskedArray.
isarray : Alias to isMaskedArray.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(data =
 [[1.0 -- --]
 [-- 1.0 --]
 [-- -- 1.0]],
      mask =
 [[False  True  True]
 [ True False  True]
 [ True  True False]],
      fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
is_mask(m)
Return True if m is a valid, standard mask.
 
This function does not check the contents of the input, only that the
type is MaskType. In particular, this function returns False if the
mask has a flexible dtype.
 
Parameters
----------
m : array_like
    Array to test.
 
Returns
-------
result : bool
    True if `m.dtype.type` is MaskType, False otherwise.
 
See Also
--------
isMaskedArray : Test whether input is an instance of MaskedArray.
 
Examples
--------
>>> import numpy.ma as ma
>>> m = ma.masked_equal([0, 1, 0, 2, 3], 0)
>>> m
masked_array(data = [-- 1 -- 2 3],
      mask = [ True False  True False False],
      fill_value=999999)
>>> ma.is_mask(m)
False
>>> ma.is_mask(m.mask)
True
 
Input must be an ndarray (or have similar attributes)
for it to be considered a valid mask.
 
>>> m = [False, True, False]
>>> ma.is_mask(m)
False
>>> m = np.array([False, True, False])
>>> m
array([False,  True, False], dtype=bool)
>>> ma.is_mask(m)
True
 
Arrays with complex dtypes don't return True.
 
>>> dtype = np.dtype({'names':['monty', 'pithon'],
                      'formats':[np.bool, np.bool]})
>>> dtype
dtype([('monty', '|b1'), ('pithon', '|b1')])
>>> m = np.array([(True, False), (False, True), (True, False)],
                 dtype=dtype)
>>> m
array([(True, False), (False, True), (True, False)],
      dtype=[('monty', '|b1'), ('pithon', '|b1')])
>>> ma.is_mask(m)
False
is_masked(x)
Determine whether input has masked values.
 
Accepts any object as input, but always returns False unless the
input is a MaskedArray containing masked values.
 
Parameters
----------
x : array_like
    Array to check for masked values.
 
Returns
-------
result : bool
    True if `x` is a MaskedArray with masked values, False otherwise.
 
Examples
--------
>>> import numpy.ma as ma
>>> x = ma.masked_equal([0, 1, 0, 2, 3], 0)
>>> x
masked_array(data = [-- 1 -- 2 3],
      mask = [ True False  True False False],
      fill_value=999999)
>>> ma.is_masked(x)
True
>>> x = ma.masked_equal([0, 1, 0, 2, 3], 42)
>>> x
masked_array(data = [0 1 0 2 3],
      mask = False,
      fill_value=999999)
>>> ma.is_masked(x)
False
 
Always returns False if `x` isn't a MaskedArray.
 
>>> x = [False, True, False]
>>> ma.is_masked(x)
False
>>> x = 'a string'
>>> ma.is_masked(x)
False
isarray = isMaskedArray(x)
Test whether input is an instance of MaskedArray.
 
This function returns True if `x` is an instance of MaskedArray
and returns False otherwise.  Any object is accepted as input.
 
Parameters
----------
x : object
    Object to test.
 
Returns
-------
result : bool
    True if `x` is a MaskedArray.
 
See Also
--------
isMA : Alias to isMaskedArray.
isarray : Alias to isMaskedArray.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.eye(3, 3)
>>> a
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> m = ma.masked_values(a, 0)
>>> m
masked_array(data =
 [[1.0 -- --]
 [-- 1.0 --]
 [-- -- 1.0]],
      mask =
 [[False  True  True]
 [ True False  True]
 [ True  True False]],
      fill_value=0.0)
>>> ma.isMaskedArray(a)
False
>>> ma.isMaskedArray(m)
True
>>> ma.isMaskedArray([0, 1, 2])
False
left_shift(a, n)
Left shift n bits.
load(F)
Wrapper around ``cPickle.load`` which accepts either a file-like object
or a filename.
loads(strg)
Load a pickle from the current string.
make_mask(m, copy=False, shrink=True, flag=None, dtype=<type 'numpy.bool_'>)
Create a boolean mask from an array.
 
Return `m` as a boolean mask, creating a copy if necessary or requested.
The function can accept any sequence that is convertible to integers,
or ``nomask``.  Does not require that contents must be 0s and 1s, values
of 0 are interepreted as False, everything else as True.
 
Parameters
----------
m : array_like
    Potential mask.
copy : bool
    Whether to return a copy of `m` (True) or `m` itself (False).
shrink : bool
    Whether to shrink `m` to ``nomask`` if all its values are False.
flag : bool
    Deprecated equivalent of `shrink`.
dtype : dtype
    Data-type of the output mask. By default, the output mask has
    a dtype of MaskType (bool). If the dtype is flexible, each field
    has a boolean dtype.
 
Returns
-------
result : ndarray
    A boolean mask derived from `m`.
 
Examples
--------
>>> import numpy.ma as ma
>>> m = [True, False, True, True]
>>> ma.make_mask(m)
array([ True, False,  True,  True], dtype=bool)
>>> m = [1, 0, 1, 1]
>>> ma.make_mask(m)
array([ True, False,  True,  True], dtype=bool)
>>> m = [1, 0, 2, -3]
>>> ma.make_mask(m)
array([ True, False,  True,  True], dtype=bool)
 
Effect of the `shrink` parameter.
 
>>> m = np.zeros(4)
>>> m
array([ 0.,  0.,  0.,  0.])
>>> ma.make_mask(m)
False
>>> ma.make_mask(m, shrink=False)
array([False, False, False, False], dtype=bool)
 
Using a flexible `dtype`.
 
>>> m = [1, 0, 1, 1]
>>> n = [0, 1, 0, 0]
>>> arr = []
>>> for man, mouse in zip(m, n):
...     arr.append((man, mouse))
>>> arr
[(1, 0), (0, 1), (1, 0), (1, 0)]
>>> dtype = np.dtype({'names':['man', 'mouse'],
                      'formats':[np.int, np.int]})
>>> arr = np.array(arr, dtype=dtype)
>>> arr
array([(1, 0), (0, 1), (1, 0), (1, 0)],
      dtype=[('man', '<i4'), ('mouse', '<i4')])
>>> ma.make_mask(arr, dtype=dtype)
array([(True, False), (False, True), (True, False), (True, False)],
      dtype=[('man', '|b1'), ('mouse', '|b1')])
make_mask_descr(ndtype)
Construct a dtype description list from a given dtype.
 
Returns a new dtype object, with the type of all fields in `ndtype` to a
boolean type. Field names are not altered.
 
Parameters
----------
ndtype : dtype
    The dtype to convert.
 
Returns
-------
result : dtype
    A dtype that looks like `ndtype`, the type of all fields is boolean.
 
Examples
--------
>>> import numpy.ma as ma
>>> dtype = np.dtype({'names':['foo', 'bar'],
                      'formats':[np.float32, np.int]})
>>> dtype
dtype([('foo', '<f4'), ('bar', '<i4')])
>>> ma.make_mask_descr(dtype)
dtype([('foo', '|b1'), ('bar', '|b1')])
>>> ma.make_mask_descr(np.float32)
<type 'numpy.bool_'>
make_mask_none(newshape, dtype=None)
Return a boolean mask of the given shape, filled with False.
 
This function returns a boolean ndarray with all entries False, that can
be used in common mask manipulations. If a complex dtype is specified, the
type of each field is converted to a boolean type.
 
Parameters
----------
newshape : tuple
    A tuple indicating the shape of the mask.
dtype: {None, dtype}, optional
    If None, use a MaskType instance. Otherwise, use a new datatype with
    the same fields as `dtype`, converted to boolean types.
 
Returns
-------
result : ndarray
    An ndarray of appropriate shape and dtype, filled with False.
 
See Also
--------
make_mask : Create a boolean mask from an array.
make_mask_descr : Construct a dtype description list from a given dtype.
 
Examples
--------
>>> import numpy.ma as ma
>>> ma.make_mask_none((3,))
array([False, False, False], dtype=bool)
 
Defining a more complex dtype.
 
>>> dtype = np.dtype({'names':['foo', 'bar'],
                      'formats':[np.float32, np.int]})
>>> dtype
dtype([('foo', '<f4'), ('bar', '<i4')])
>>> ma.make_mask_none((3,), dtype=dtype)
array([(False, False), (False, False), (False, False)],
      dtype=[('foo', '|b1'), ('bar', '|b1')])
mask_or(m1, m2, copy=False, shrink=True)
Return the combination of two masks m1 and m2.
 
The masks are combined with the *logical_or* operator, treating
nomask as False.  The result may equal m1 or m2 if the other is
nomask.
 
Parameters
----------
m1 : array_like
    First mask.
m2 : array_like
    Second mask
copy : {False, True}, optional
    Whether to return a copy.
shrink : {True, False}, optional
    Whether to shrink m to nomask if all its values are False.
 
Raises
------
ValueError
    If m1 and m2 have different flexible dtypes.
masked_equal(x, value, copy=True)
Mask an array where equal to a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x == value).  For floating point arrays,
consider using ``masked_values(x, value)``.
 
See Also
--------
masked_where : Mask where a condition is met.
masked_values : Mask using floating point equality.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_equal(a, 2)
masked_array(data = [0 1 -- 3],
      mask = [False False  True False],
      fill_value=999999)
masked_greater(x, value, copy=True)
Mask an array where greater than a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x > value).
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_greater(a, 2)
masked_array(data = [0 1 2 --],
      mask = [False False False  True],
      fill_value=999999)
masked_greater_equal(x, value, copy=True)
Mask an array where greater than or equal to a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x >= value).
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_greater_equal(a, 2)
masked_array(data = [0 1 -- --],
      mask = [False False  True  True],
      fill_value=999999)
masked_inside(x, v1, v2, copy=True)
Mask an array inside a given interval.
 
Shortcut to ``masked_where``, where `condition` is True for `x` inside
the interval [v1,v2] (v1 <= x <= v2).  The boundaries `v1` and `v2`
can be given in either order.
 
See Also
--------
masked_where : Mask where a condition is met.
 
Notes
-----
The array `x` is prefilled with its filling value.
 
Examples
--------
>>> import numpy.ma as ma
>>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1]
>>> ma.masked_inside(x, -0.3, 0.3)
masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
      mask = [False False  True  True False False],
      fill_value=1e+20)
 
The order of `v1` and `v2` doesn't matter.
 
>>> ma.masked_inside(x, 0.3, -0.3)
masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
      mask = [False False  True  True False False],
      fill_value=1e+20)
masked_invalid(a, copy=True)
Mask an array where invalid values occur (NaNs or infs).
 
This function is a shortcut to ``masked_where``, with
`condition` = ~(np.isfinite(a)). Any pre-existing mask is conserved.
Only applies to arrays with a dtype where NaNs or infs make sense
(i.e. floating point types), but accepts any array_like object.
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(5, dtype=np.float)
>>> a[2] = np.NaN
>>> a[3] = np.PINF
>>> a
array([  0.,   1.,  NaN,  Inf,   4.])
>>> ma.masked_invalid(a)
masked_array(data = [0.0 1.0 -- -- 4.0],
      mask = [False False  True  True False],
      fill_value=1e+20)
masked_less(x, value, copy=True)
Mask an array where less than a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x < value).
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_less(a, 2)
masked_array(data = [-- -- 2 3],
      mask = [ True  True False False],
      fill_value=999999)
masked_less_equal(x, value, copy=True)
Mask an array where less than or equal to a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x <= value).
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_less_equal(a, 2)
masked_array(data = [-- -- -- 3],
      mask = [ True  True  True False],
      fill_value=999999)
masked_not_equal(x, value, copy=True)
Mask an array where `not` equal to a given value.
 
This function is a shortcut to ``masked_where``, with
`condition` = (x != value).
 
See Also
--------
masked_where : Mask where a condition is met.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_not_equal(a, 2)
masked_array(data = [-- -- 2 --],
      mask = [ True  True False  True],
      fill_value=999999)
masked_object(x, value, copy=True, shrink=True)
Mask the array `x` where the data are exactly equal to value.
 
This function is similar to `masked_values`, but only suitable
for object arrays: for floating point, use `masked_values` instead.
 
Parameters
----------
x : array_like
    Array to mask
value : object
    Comparison value
copy : {True, False}, optional
    Whether to return a copy of `x`.
shrink : {True, False}, optional
    Whether to collapse a mask full of False to nomask
 
Returns
-------
result : MaskedArray
    The result of masking `x` where equal to `value`.
 
See Also
--------
masked_where : Mask where a condition is met.
masked_equal : Mask where equal to a given value (integers).
masked_values : Mask using floating point equality.
 
Examples
--------
>>> import numpy.ma as ma
>>> food = np.array(['green_eggs', 'ham'], dtype=object)
>>> # don't eat spoiled food
>>> eat = ma.masked_object(food, 'green_eggs')
>>> print eat
[-- ham]
>>> # plain ol` ham is boring
>>> fresh_food = np.array(['cheese', 'ham', 'pineapple'], dtype=object)
>>> eat = ma.masked_object(fresh_food, 'green_eggs')
>>> print eat
[cheese ham pineapple]
 
Note that `mask` is set to ``nomask`` if possible.
 
>>> eat
masked_array(data = [cheese ham pineapple],
      mask = False,
      fill_value=?)
masked_outside(x, v1, v2, copy=True)
Mask an array outside a given interval.
 
Shortcut to ``masked_where``, where `condition` is True for `x` outside
the interval [v1,v2] (x < v1)|(x > v2).
The boundaries `v1` and `v2` can be given in either order.
 
See Also
--------
masked_where : Mask where a condition is met.
 
Notes
-----
The array `x` is prefilled with its filling value.
 
Examples
--------
>>> import numpy.ma as ma
>>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1]
>>> ma.masked_outside(x, -0.3, 0.3)
masked_array(data = [-- -- 0.01 0.2 -- --],
      mask = [ True  True False False  True  True],
      fill_value=1e+20)
 
The order of `v1` and `v2` doesn't matter.
 
>>> ma.masked_outside(x, 0.3, -0.3)
masked_array(data = [-- -- 0.01 0.2 -- --],
      mask = [ True  True False False  True  True],
      fill_value=1e+20)
masked_values(x, value, rtol=1.0000000000000001e-05, atol=1e-08, copy=True, shrink=True)
Mask using floating point equality.
 
Return a MaskedArray, masked where the data in array `x` are approximately
equal to `value`, i.e. where the following condition is True
 
(abs(x - value) <= atol+rtol*abs(value))
 
The fill_value is set to `value` and the mask is set to ``nomask`` if
possible.  For integers, consider using ``masked_equal``.
 
Parameters
----------
x : array_like
    Array to mask.
value : float
    Masking value.
rtol : float, optional
    Tolerance parameter.
atol : float, optional
    Tolerance parameter (1e-8).
copy : {True, False}, optional
    Whether to return a copy of `x`.
shrink : {True, False}, optional
    Whether to collapse a mask full of False to ``nomask``
 
Returns
-------
result : MaskedArray
    The result of masking `x` where approximately equal to `value`.
 
See Also
--------
masked_where : Mask where a condition is met.
masked_equal : Mask where equal to a given value (integers).
 
Examples
--------
>>> import numpy.ma as ma
>>> x = np.array([1, 1.1, 2, 1.1, 3])
>>> ma.masked_values(x, 1.1)
masked_array(data = [1.0 -- 2.0 -- 3.0],
      mask = [False  True False  True False],
      fill_value=1.1)
 
Note that `mask` is set to ``nomask`` if possible.
 
>>> ma.masked_values(x, 1.5)
masked_array(data = [ 1.   1.1  2.   1.1  3. ],
      mask = False,
      fill_value=1.5)
 
For integers, the fill value will be different in general to the
result of ``masked_equal``.
 
>>> x = np.arange(5)
>>> x
array([0, 1, 2, 3, 4])
>>> ma.masked_values(x, 2)
masked_array(data = [0 1 -- 3 4],
      mask = [False False  True False False],
      fill_value=2)
>>> ma.masked_equal(x, 2)
masked_array(data = [0 1 -- 3 4],
      mask = [False False  True False False],
      fill_value=999999)
masked_where(condition, a, copy=True)
Mask an array where a condition is met.
 
Return `a` as an array masked where `condition` is True.
Any masked values of `a` or `condition` are also masked in the output.
 
Parameters
----------
condition : array_like
    Masking condition.  When `condition` tests floating point values for
    equality, consider using ``masked_values`` instead.
a : array_like
    Array to mask.
copy : bool
    If True (default) make a copy of `a` in the result.  If False modify
    `a` in place and return a view.
 
Returns
-------
result : MaskedArray
    The result of masking `a` where `condition` is True.
 
See Also
--------
masked_values : Mask using floating point equality.
masked_equal : Mask where equal to a given value.
masked_not_equal : Mask where `not` equal to a given value.
masked_less_equal : Mask where less than or equal to a given value.
masked_greater_equal : Mask where greater than or equal to a given value.
masked_less : Mask where less than a given value.
masked_greater : Mask where greater than a given value.
masked_inside : Mask inside a given interval.
masked_outside : Mask outside a given interval.
masked_invalid : Mask invalid values (NaNs or infs).
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(4)
>>> a
array([0, 1, 2, 3])
>>> ma.masked_where(a <= 2, a)
masked_array(data = [-- -- -- 3],
      mask = [ True  True  True False],
      fill_value=999999)
 
Mask array `b` conditional on `a`.
 
>>> b = ['a', 'b', 'c', 'd']
>>> ma.masked_where(a == 2, b)
masked_array(data = [a b -- d],
      mask = [False False  True False],
      fill_value=N/A)
 
Effect of the `copy` argument.
 
>>> c = ma.masked_where(a <= 2, a)
>>> c
masked_array(data = [-- -- -- 3],
      mask = [ True  True  True False],
      fill_value=999999)
>>> c[0] = 99
>>> c
masked_array(data = [99 -- -- 3],
      mask = [False  True  True False],
      fill_value=999999)
>>> a
array([0, 1, 2, 3])
>>> c = ma.masked_where(a <= 2, a, copy=False)
>>> c[0] = 99
>>> c
masked_array(data = [99 -- -- 3],
      mask = [False  True  True False],
      fill_value=999999)
>>> a
array([99,  1,  2,  3])
 
When `condition` or `a` contain masked values.
 
>>> a = np.arange(4)
>>> a = ma.masked_where(a == 2, a)
>>> a
masked_array(data = [0 1 -- 3],
      mask = [False False  True False],
      fill_value=999999)
>>> b = np.arange(4)
>>> b = ma.masked_where(b == 0, b)
>>> b
masked_array(data = [-- 1 2 3],
      mask = [ True False False False],
      fill_value=999999)
>>> ma.masked_where(a == 3, b)
masked_array(data = [-- 1 -- --],
      mask = [ True False  True  True],
      fill_value=999999)
max(obj, axis=None, out=None, fill_value=None)
Return the maximum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must
    be of the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of maximum_fill_value().
 
Returns
-------
amax : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
maximum_fill_value
    Returns the maximum filling value for a given datatype.
maximum_fill_value(obj)
Calculate the default fill value suitable for taking the maximum of ``obj``.
min(obj, axis=None, out=None, fill_value=None)
Return the minimum along a given axis.
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to operate.  By default, ``axis`` is None and the
    flattened input is used.
out : array_like, optional
    Alternative output array in which to place the result.  Must be of
    the same shape and buffer length as the expected output.
fill_value : {var}, optional
    Value used to fill in the masked values.
    If None, use the output of `minimum_fill_value`.
 
Returns
-------
amin : array_like
    New array holding the result.
    If ``out`` was specified, ``out`` is returned.
 
See Also
--------
minimum_fill_value
    Returns the minimum filling value for a given datatype.
minimum_fill_value(obj)
Calculate the default fill value suitable for taking the minimum of ``obj``.
narray = array(...)
array(object, dtype=None, copy=True, order=None, subok=False, ndmin=True)
 
Create an array.
 
Parameters
----------
object : array_like
    An array, any object exposing the array interface, an
    object whose __array__ method returns an array, or any
    (nested) sequence.
dtype : data-type, optional
    The desired data-type for the array.  If not given, then
    the type will be determined as the minimum type required
    to hold the objects in the sequence.  This argument can only
    be used to 'upcast' the array.  For downcasting, use the
    .astype(t) method.
copy : bool, optional
    If true (default), then the object is copied.  Otherwise, a copy
    will only be made if __array__ returns a copy, if obj is a
    nested sequence, or if a copy is needed to satisfy any of the other
    requirements (`dtype`, `order`, etc.).
order : {'C', 'F', 'A'}, optional
    Specify the order of the array.  If order is 'C' (default), then the
    array will be in C-contiguous order (last-index varies the
    fastest).  If order is 'F', then the returned array
    will be in Fortran-contiguous order (first-index varies the
    fastest).  If order is 'A', then the returned array may
    be in any order (either C-, Fortran-contiguous, or even
    discontiguous).
subok : bool, optional
    If True, then sub-classes will be passed-through, otherwise
    the returned array will be forced to be a base-class array (default).
ndmin : int, optional
    Specifies the minimum number of dimensions that the resulting
    array should have.  Ones will be pre-pended to the shape as
    needed to meet this requirement.
 
Examples
--------
>>> np.array([1, 2, 3])
array([1, 2, 3])
 
Upcasting:
 
>>> np.array([1, 2, 3.0])
array([ 1.,  2.,  3.])
 
More than one dimension:
 
>>> np.array([[1, 2], [3, 4]])
array([[1, 2],
       [3, 4]])
 
Minimum dimensions 2:
 
>>> np.array([1, 2, 3], ndmin=2)
array([[1, 2, 3]])
 
Type provided:
 
>>> np.array([1, 2, 3], dtype=complex)
array([ 1.+0.j,  2.+0.j,  3.+0.j])
 
Data-type consisting of more than one element:
 
>>> x = np.array([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')])
>>> x['a']
array([1, 3])
 
Creating an array from sub-classes:
 
>>> np.array(np.mat('1 2; 3 4'))
array([[1, 2],
       [3, 4]])
 
>>> np.array(np.mat('1 2; 3 4'), subok=True)
matrix([[1, 2],
        [3, 4]])
outer(a, b)
Returns the outer product of two vectors.
 
Given two vectors, ``[a0, a1, ..., aM]`` and ``[b0, b1, ..., bN]``,
the outer product becomes::
 
  [[a0*b0  a0*b1 ... a0*bN ]
   [a1*b0    .
   [ ...          .
   [aM*b0            aM*bN ]]
 
Parameters
----------
a : array_like, shaped (M,)
    First input vector.  If either of the input vectors are not
    1-dimensional, they are flattened.
b : array_like, shaped (N,)
    Second input vector.
 
Returns
-------
out : ndarray, shaped (M, N)
    ``out[i, j] = a[i] * b[j]``
 
Notes
-----
The outer product of vectors is a special case of the Kronecker product.
 
Examples
--------
>>> x = np.array(['a', 'b', 'c'], dtype=object)
 
>>> np.outer(x, [1, 2, 3])
array([[a, aa, aaa],
       [b, bb, bbb],
       [c, cc, ccc]], dtype=object)
 
 
 
Notes
-----
Masked values are replaced by 0.
outerproduct = outer(a, b)
Returns the outer product of two vectors.
 
Given two vectors, ``[a0, a1, ..., aM]`` and ``[b0, b1, ..., bN]``,
the outer product becomes::
 
  [[a0*b0  a0*b1 ... a0*bN ]
   [a1*b0    .
   [ ...          .
   [aM*b0            aM*bN ]]
 
Parameters
----------
a : array_like, shaped (M,)
    First input vector.  If either of the input vectors are not
    1-dimensional, they are flattened.
b : array_like, shaped (N,)
    Second input vector.
 
Returns
-------
out : ndarray, shaped (M, N)
    ``out[i, j] = a[i] * b[j]``
 
Notes
-----
The outer product of vectors is a special case of the Kronecker product.
 
Examples
--------
>>> x = np.array(['a', 'b', 'c'], dtype=object)
 
>>> np.outer(x, [1, 2, 3])
array([[a, aa, aaa],
       [b, bb, bbb],
       [c, cc, ccc]], dtype=object)
 
 
 
Notes
-----
Masked values are replaced by 0.
power(a, b, third=None)
Computes a**b elementwise.
ptp(obj, axis=None, out=None, fill_value=None)
Return (maximum - minimum) along the the given dimension
(i.e. peak-to-peak value).
 
Parameters
----------
axis : {None, int}, optional
    Axis along which to find the peaks.  If None (default) the
    flattened array is used.
out : {None, array_like}, optional
    Alternative output array in which to place the result. It must
    have the same shape and buffer length as the expected output
    but the type will be cast if necessary.
fill_value : {var}, optional
    Value used to fill in the masked values.
 
Returns
-------
ptp : ndarray.
    A new array holding the result, unless ``out`` was
    specified, in which case a reference to ``out`` is returned.
put(a, indices, values, mode='raise')
Set storage-indexed locations to corresponding values.
 
Values and indices are filled if necessary.
putmask(a, mask, values)
Set a.flat[n] = values[n] for each n where mask.flat[n] is true.
 
If values is not the same size of a and mask then it will repeat
as necessary.  This gives different behavior than
a[mask] = values.
 
Note: Using a masked array as values will NOT transform a ndarray in
      a maskedarray.
rank(obj)
Return the number of dimensions of an array.
 
If `a` is not already an array, a conversion is attempted.
Scalars are zero dimensional.
 
Parameters
----------
a : array_like
    Array whose number of dimensions is desired. If `a` is not an array,
    a conversion is attempted.
 
Returns
-------
number_of_dimensions : int
    The number of dimensions in the array.
 
See Also
--------
ndim : equivalent function
ndarray.ndim : equivalent property
shape : dimensions of array
ndarray.shape : dimensions of array
 
Notes
-----
In the old Numeric package, `rank` was the term used for the number of
dimensions, but in Numpy `ndim` is used instead.
 
Examples
--------
>>> np.rank([1,2,3])
1
>>> np.rank(np.array([[1,2,3],[4,5,6]]))
2
>>> np.rank(1)
0
reshape(a, new_shape, order='C')
Change the shape of the array a to new_shape.
resize(x, new_shape)
Return a new array with the specified shape.
 
The total size of the original array can be any size.  The new
array is filled with repeated copies of a. If a was masked, the
new array will be masked, and the new mask will be a repetition of
the old one.
right_shift(a, n)
Right shift n bits.
round = round_(a, decimals=0, out=None)
Return a copy of a, rounded to 'decimals' places.
 
When 'decimals' is negative, it specifies the number of positions
to the left of the decimal point.  The real and imaginary parts of
complex numbers are rounded separately. Nothing is done if the
array is not of float type and 'decimals' is greater than or equal
to 0.
 
Parameters
----------
decimals : int
    Number of decimals to round to. May be negative.
out : array_like
    Existing array to use for output.
    If not given, returns a default copy of a.
 
Notes
-----
If out is given and does not have a mask attribute, the mask of a
is lost!
round_(a, decimals=0, out=None)
Return a copy of a, rounded to 'decimals' places.
 
When 'decimals' is negative, it specifies the number of positions
to the left of the decimal point.  The real and imaginary parts of
complex numbers are rounded separately. Nothing is done if the
array is not of float type and 'decimals' is greater than or equal
to 0.
 
Parameters
----------
decimals : int
    Number of decimals to round to. May be negative.
out : array_like
    Existing array to use for output.
    If not given, returns a default copy of a.
 
Notes
-----
If out is given and does not have a mask attribute, the mask of a
is lost!
set_fill_value(a, fill_value)
Set the filling value of a, if a is a masked array.
 
This function changes the fill value of the masked array `a` in place.
If `a` is not a masked array, the function returns silently, without
doing anything.
 
Parameters
----------
a : array_like
    Input array.
fill_value : dtype
    Filling value. A consistency test is performed to make sure
    the value is compatible with the dtype of `a`.
 
Returns
-------
None
    Nothing returned by this function.
 
See Also
--------
maximum_fill_value : Return the default fill value for a dtype.
MaskedArray.fill_value : Return current fill value.
 
Examples
--------
>>> import numpy.ma as ma
>>> a = np.arange(5)
>>> a
array([0, 1, 2, 3, 4])
>>> a = ma.masked_where(a < 3, a)
>>> a
masked_array(data = [-- -- -- 3 4],
      mask = [ True  True  True False False],
      fill_value=999999)
>>> ma.set_fill_value(a, -999)
>>> a
masked_array(data = [-- -- -- 3 4],
      mask = [ True  True  True False False],
      fill_value=-999)
 
Nothing happens if `a` is not a masked array.
 
>>> a = range(5)
>>> a
[0, 1, 2, 3, 4]
>>> ma.set_fill_value(a, 100)
>>> a
[0, 1, 2, 3, 4]
>>> a = np.arange(5)
>>> a
array([0, 1, 2, 3, 4])
>>> ma.set_fill_value(a, 100)
>>> a
array([0, 1, 2, 3, 4])
shape(obj)
Return the shape of an array.
 
Parameters
----------
a : array_like
    Input array.
 
Returns
-------
shape : tuple
    The elements of the tuple give the lengths of the corresponding array
    dimensions.
 
See Also
--------
alen,
ndarray.shape : array method
 
Examples
--------
>>> np.shape(np.eye(3))
(3, 3)
>>> np.shape([[1,2]])
(1, 2)
>>> np.shape([0])
(1,)
>>> np.shape(0)
()
 
>>> a = np.array([(1,2),(3,4)], dtype=[('x', 'i4'), ('y', 'i4')])
>>> np.shape(a)
(2,)
>>> a.shape
(2,)
size(obj, axis=None)
Return the number of elements along a given axis.
 
Parameters
----------
a : array_like
    Input data.
axis : int, optional
    Axis along which the elements are counted.  By default, give
    the total number of elements.
 
Returns
-------
element_count : int
    Number of elements along the specified axis.
 
See Also
--------
shape : dimensions of array
ndarray.shape : dimensions of array
ndarray.size : number of elements in array
 
Examples
--------
>>> a = np.array([[1,2,3],[4,5,6]])
>>> np.size(a)
6
>>> np.size(a,1)
3
>>> np.size(a,0)
2
sometrue = reduce(self, target, axis=0, dtype=None) method of _MaskedBinaryOperation instance
Reduce `target` along the given `axis`.
sort(a, axis=-1, kind='quicksort', order=None, endwith=True, fill_value=None)
Return a sorted copy of an array.
 
Parameters
----------
a : array_like
    Array to be sorted.
axis : int or None, optional
    Axis along which to sort. If None, the array is flattened before
    sorting. The default is -1, which sorts along the last axis.
kind : {'quicksort', 'mergesort', 'heapsort'}, optional
    Sorting algorithm. Default is 'quicksort'.
order : list, optional
    When `a` is a structured array, this argument specifies which fields
    to compare first, second, and so on.  This list does not need to
    include all of the fields.
endwith : {True, False}, optional
    Whether missing values (if any) should be forced in the upper indices
    (at the end of the array) (True) or lower indices (at the beginning).
fill_value : {var}
    Value used to fill in the masked values.  If None, use
    the the output of minimum_fill_value().
 
Returns
-------
sorted_array : ndarray
    Array of the same type and shape as `a`.
 
See Also
--------
ndarray.sort : Method to sort an array in-place.
argsort : Indirect sort.
lexsort : Indirect stable sort on multiple keys.
searchsorted : Find elements in a sorted array.
 
Notes
-----
The various sorting algorithms are characterized by their average speed,
worst case performance, work space size, and whether they are stable. A
stable sort keeps items with the same key in the same relative
order. The three available algorithms have the following
properties:
 
=========== ======= ============= ============ =======
   kind      speed   worst case    work space  stable
=========== ======= ============= ============ =======
'quicksort'    1     O(n^2)            0          no
'mergesort'    2     O(n*log(n))      ~n/2        yes
'heapsort'     3     O(n*log(n))       0          no
=========== ======= ============= ============ =======
 
All the sort algorithms make temporary copies of the data when
sorting along any but the last axis.  Consequently, sorting along
the last axis is faster and uses less space than sorting along
any other axis.
 
Examples
--------
>>> a = np.array([[1,4],[3,1]])
>>> np.sort(a)                # sort along the last axis
array([[1, 4],
       [1, 3]])
>>> np.sort(a, axis=None)     # sort the flattened array
array([1, 1, 3, 4])
>>> np.sort(a, axis=0)        # sort along the first axis
array([[1, 1],
       [3, 4]])
 
Use the `order` keyword to specify a field to use when sorting a
structured array:
 
>>> dtype = [('name', 'S10'), ('height', float), ('age', int)]
>>> values = [('Arthur', 1.8, 41), ('Lancelot', 1.9, 38),
...           ('Galahad', 1.7, 38)]
>>> a = np.array(values, dtype=dtype)       # create a structured array
>>> np.sort(a, order='height')                        # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41),
       ('Lancelot', 1.8999999999999999, 38)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
 
Sort by age, then height if ages are equal:
 
>>> np.sort(a, order=['age', 'height'])               # doctest: +SKIP
array([('Galahad', 1.7, 38), ('Lancelot', 1.8999999999999999, 38),
       ('Arthur', 1.8, 41)],
      dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
transpose(a, axes=None)
Return a view of the array with dimensions permuted according to axes,
as a masked array.
 
If ``axes`` is None (default), the output view has reversed
dimensions compared to the original.
where(condition, x=None, y=None)
where(condition | x, y)
 
Returns a (subclass of) masked array, shaped like condition, where
the elements are x when condition is True, and y otherwise.  If
neither x nor y are given, returns a tuple of indices where
condition is True (a la condition.nonzero()).
 
Parameters
----------
condition : {var}
    The condition to meet. Must be convertible to an integer
    array.
x : {var}, optional
    Values of the output when the condition is met
y : {var}, optional
    Values of the output when the condition is not met.

 
Data
        __all__ = ['MAError', 'MaskError', 'MaskType', 'MaskedArray', 'bool_', 'abs', 'absolute', 'add', 'all', 'allclose', 'allequal', 'alltrue', 'amax', 'amin', 'anom', 'anomalies', 'any', 'arange', 'arccos', 'arccosh', ...]
__author__ = 'Pierre GF Gerard-Marchant'
__docformat__ = 'restructuredtext en'
__file__ = '/usr/lib/python2.6/dist-packages/numpy/ma/core.pyc'
__name__ = 'numpy.ma.core'
__package__ = 'numpy.ma'
_print_templates = {'long': 'masked_%(name)s(data =\n %(data)s,\n %(nlen)...sk =\n %(mask)s,\n %(nlen)s fill_value = %(fill)s)\n', 'long_flx': 'masked_%(name)s(data =\n %(data)s,\n %(nlen)...ue = %(fill)s,\n %(nlen)s dtype = %(dtype)s)\n', 'short': 'masked_%(name)s(data = %(data)s,\n %(nlen)s mask = %(mask)s,\n%(nlen)s fill_value = %(fill)s)\n', 'short_flx': 'masked_%(name)s(data = %(data)s,\n%(nlen)s ...ue = %(fill)s,\n%(nlen)s dtype = %(dtype)s)\n'}
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>
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>
default_filler = {'O': '?', 'S': 'N/A', 'V': '???', 'b': True, 'c': (1e+20+0j), 'f': 1e+20, 'i': 999999, 'u': 999999}
diagonal = <numpy.ma.core._frommethod instance at 0x247a320>
divide = <numpy.ma.core._DomainedBinaryOperation instance at 0x2472200>
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>
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)
max_filler = {<type 'numpy.int64'>: -9223372036854775808L, <t...py.complex128'>: None, <type 'numpy.void'>: None}
maximum = <numpy.ma.core._maximum_operation object at 0x24790d0>
mean = <numpy.ma.core._frommethod instance at 0x247a488>
min_filler = {<type 'numpy.int64'>: 9223372036854775807L, <ty...py.complex128'>: None, <type 'numpy.void'>: None}
minimum = <numpy.ma.core._minimum_operation object at 0x2479110>
mod = <numpy.ma.core._DomainedBinaryOperation instance at 0x24725f0>
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>
shrink_mask = <numpy.ma.core._frommethod instance at 0x247a7a0>
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>
ufunc_domain = {<function round_ at 0x22bda28>: None, <ufunc 'cos'>: None, <ufunc 'add'>: None, <ufunc 'arcsinh'>: None, <ufunc 'bitwise_and'>: None, <ufunc 'arctanh'>: <numpy.ma.core._DomainCheckInterval instance at 0x246e950>, <ufunc 'arctan'>: None, <ufunc 'arctan2'>: None, <ufunc 'conjugate'>: None, <ufunc 'bitwise_or'>: None, ...}
ufunc_fills = {<function round_ at 0x22bda28>: 0, <ufunc 'cos'>: 0, <ufunc 'add'>: (0, 0), <ufunc 'arcsinh'>: 0, <ufunc 'bitwise_and'>: (0, 0), <ufunc 'arctanh'>: 0.0, <ufunc 'arctan'>: 0, <ufunc 'arctan2'>: (0.0, 1.0), <ufunc 'conjugate'>: 0, <ufunc 'bitwise_or'>: (0, 0), ...}
var = <numpy.ma.core._frommethod instance at 0x247aa70>
zeros = <numpy.ma.core._convert2ma instance at 0x247d098>

 
Author
        Pierre GF Gerard-Marchant