Find contiguous unmasked data in a masked array along the given axis.
Parameters: | a : narray
|
---|---|
Returns: | slice_list : list
|
Notes
Only accepts 2-D arrays at most.
Examples
>>> a = np.arange(10)
>>> mask = (a < 3) | (a > 8) | (a == 5)
>>> ma = np.ma.array(a, mask=mask)
>>> np.array(ma[~ma.mask])
array([3, 4, 6, 7, 8])
>>> np.ma.extras.flatnotmasked_contiguous(ma)
[slice(3, 4, None), slice(6, 8, None)]
>>> ma = np.ma.array(a, mask=np.ones_like(a))
>>> print np.ma.extras.flatnotmasked_edges(ma)
None