numpy.ma.MaskedArray.compressed

MaskedArray.compressed()

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'>

Previous topic

numpy.ma.filled

Next topic

numpy.ma.MaskedArray.filled

This Page

Quick search