bundles / numpy latest / numpy / ma / extras / clump_masked
function
numpy.ma.extras:clump_masked
source: build-install/usr/lib/python3.14/site-packages/numpy/ma/extras.py:2175
Signature
def clump_masked(a)Summary
Returns a list of slices corresponding to the masked clumps of a 1-D array. (A "clump" is defined as a contiguous region of the array).
Parameters
a: ndarrayA one-dimensional masked array.
Returns
slices: list of sliceThe list of slices, one for each continuous region of masked elements in
a.
Examples
import numpy as np a = np.ma.masked_array(np.arange(10)) a[[0, 1, 2, 6, 8, 9]] = np.ma.masked✓
np.ma.clump_masked(a)
✗[slice(0, np.int64(3), None), slice(np.int64(6), np.int64(7), None), slice(np.int64(8), 10, None)]
See also
Aliases
numpy.ma.clump_masked