numpy.ma.notmasked_edges()

numpy.ma.notmasked_edges

numpy.ma.notmasked_edges(a, axis=None) [source]

Find the indices of the first and last unmasked values along an axis.

If all values are masked, return None. Otherwise, return a list of two tuples, corresponding to the indices of the first and last unmasked values respectively.

Parameters:

a : array_like

The input array.

axis : int, optional

Axis along which to perform the operat