Find contiguous unmasked data in a masked array along the given axis.
Parameters: | a : array_like
axis : int, optional
|
---|---|
Returns: | endpoints : list
|
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, 3, None), slice(6, 6, None)]