### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Masked array operations »

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

### Navigation

- index
- modules |
- next |
- previous |
- NumPy v1.3 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Masked array operations »