Skip to main content
`Ctrl`+`K`

# numpy.ma.masked_array.shrink_mask

method

ma.masked_array.shrink_mask()

  Reduce a mask to nomask when possible.

  Parameters:
    None
  Returns:
    result MaskedArray

      A `MaskedArray` object.

  Examples

      >>> import numpy as np
      >>> x = np.ma.array([[1,2 ], [3, 4]], mask=[0]*4)
      >>> x.mask
      array([[False, False],
             [False, False]])
      >>> x.shrink_mask()
      masked_array(
        data=[[1, 2],
              [3, 4]],
        mask=False,
        fill_value=999999)
      >>> x.mask
      False