Find contiguous unmasked data in a masked array along the given axis.
Parameters : | a : array_like
axis : int, optional
|
---|---|
Returns : | endpoints : list
|
See also
flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges, clump_masked, clump_unmasked
Notes
Only accepts 2-D arrays at most.
Examples
>>> a = np.arange(9).reshape((3, 3))
>>> mask = np.zeros_like(a)
>>> mask[1:, 1:] = 1
>>> ma = np.ma.array(a, mask=mask)
>>> np.array(ma[~ma.mask])
array([0, 1, 2, 3, 6])
>>> np.ma.extras.notmasked_contiguous(ma)
[slice(0, 4, None), slice(6, 7, None)]