### Navigation

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

# numpy.ma.flatnotmasked_edges

`numpy.ma.``flatnotmasked_edges`(a)

  Find the indices of the first and last unmasked values.

  Expects a 1-D MaskedArray, returns None if all values are masked.

  Parameters : | arr : array_like Input 1-D MaskedArray
  Returns : | edges : ndarray or None The indices of first and last non-masked value in the array. Returns None if all values are masked.

  See also

  `flatnotmasked_contiguous`, `notmasked_contiguous`, `notmasked_edges`

  Notes

  Only accepts 1-D arrays.

  Examples

      >>> a = np.arange(10)
      >>> mask = (a < 3) | (a > 8) | (a == 5)

      >>> ma = np.ma.array(a, mask=m)
      >>> np.array(ma[~ma.mask])
      array([3, 4, 6, 7, 8])

      >>> flatnotmasked_edges(ma)
      array([3, 8])

      >>> ma = np.ma.array(a, mask=np.ones_like(a))
      >>> print flatnotmasked_edges(ma)
      None

### Navigation

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