On this page
numpy.ma.clump_unmasked
ma.clump_unmasked(a)[source]- 
    
Return list of slices corresponding to the unmasked clumps of a 1-D array. (A “clump” is defined as a contiguous region of the array).
- Parameters
 - 
      
andarray- 
        
A one-dimensional masked array.
 
 - Returns
 - 
      
sliceslist of slice- 
        
The list of slices, one for each continuous region of unmasked elements in
a. 
 
See also
flatnotmasked_edges, flatnotmasked_contiguous,notmasked_edgesnotmasked_contiguous,clump_masked
Notes
New in version 1.4.0.
Examples
>>> a = np.ma.masked_array(np.arange(10)) >>> a[[0, 1, 2, 6, 8, 9]] = np.ma.masked >>> np.ma.clump_unmasked(a) [slice(3, 6, None), slice(7, 8, None)] 
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
 https://numpy.org/doc/1.20/reference/generated/numpy.ma.clump_unmasked.html