# numpy 2.5.4 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

    Find contiguous unmasked data in a masked array along the given axis.

    Parameters
    ----------
    a : array_like
        The input array.
    axis : int, optional
        Axis along which to perform the operation.
        If None (default), applies to a flattened version of the array, and this
        is the same as `flatnotmasked_contiguous`.

    Returns
    -------
    endpoints : list
        A list of slices (start and end indexes) of unmasked indexes
        in the array.

        If the input is 2d and axis is specified, the result is a list of lists.

    See Also
    --------
    flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges
    clump_masked, clump_unmasked

    Notes
    -----
    Only accepts 2-D arrays at most.

    Examples
    --------
    >>> import numpy as np
    >>> a = np.arange(12).reshape((3, 4))
    >>> mask = np.zeros_like(a)
    >>> mask[1:, :-1] = 1; mask[0, 1] = 1; mask[-1, 0] = 0
    >>> ma = np.ma.array(a, mask=mask)
    >>> ma
    masked_array(
      data=[[0, --, 2, 3],
            [--, --, --, 7],
            [8, --, --, 11]],
      mask=[[False,  True, False, False],
            [ True,  True,  True, False],
            [False,  True,  True, False]],
      fill_value=999999)
    >>> np.array(ma[~ma.mask])
    array([ 0,  2,  3,  7, 8, 11])

    >>> np.ma.notmasked_contiguous(ma)
    [slice(0, 1, None), slice(2, 4, None), slice(7, 9, None), slice(11, 12, None)]

    >>> np.ma.notmasked_contiguous(ma, axis=0)
    [[slice(0, 1, None), slice(2, 3, None)], [], [slice(0, 1, None)], [slice(0, 3, None)]]

    >>> np.ma.notmasked_contiguous(ma, axis=1)
    [[slice(0, 1, None), slice(2, 4, None)], [slice(3, 4, None)], [slice(0, 1, None), slice(3, 4, None)]]

    
=== parse numpydoc
short_description: 'Find contiguous unmasked data in a masked array along the given axis.'
blank_after_short_description: True
blank_after_long_description: False
style: numpydoc
- DocstringParam
  description: 'The input array.'
  kind: param
  key: 'param'
  arg_name: 'a'
  type_name: 'array_like'
  is_optional: False
- DocstringParam
  description: |
    Axis along which to perform the operation.
    If None (default), applies to a flattened version of the array, and this
    is the same as `flatnotmasked_contiguous`.
  kind: param
  key: 'param'
  arg_name: 'axis'
  type_name: 'int'
  is_optional: True
  raw_type_name: 'int, optional'
- DocstringReturns
  description: |
    A list of slices (start and end indexes) of unmasked indexes
    in the array.
    
    If the input is 2d and axis is specified, the result is a list of lists.
  kind: returns
  key: 'returns'
  type_name: 'list'
  is_generator: False
  return_name: 'endpoints'
- DocstringMeta
  description: |
    flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges
    clump_masked, clump_unmasked
  kind: text
  key: 'see_also'
  title: 'See Also'
- DocstringMeta
  description: 'Only accepts 2-D arrays at most.'
  kind: text
  key: 'notes'
  title: 'Notes'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> import numpy as np'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> a = np.arange(12).reshape((3, 4))'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> mask = np.zeros_like(a)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> mask[1:, :-1] = 1; mask[0, 1] = 1; mask[-1, 0] = 0'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> ma = np.ma.array(a, mask=mask)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> ma
    masked_array(
      data=[[0, --, 2, 3],
            [--, --, --, 7],
            [8, --, --, 11]],
      mask=[[False,  True, False, False],
            [ True,  True,  True, False],
            [False,  True,  True, False]],
      fill_value=999999)
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> np.array(ma[~ma.mask])
    array([ 0,  2,  3,  7, 8, 11])
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> np.ma.notmasked_contiguous(ma)
    [slice(0, 1, None), slice(2, 4, None), slice(7, 9, None), slice(11, 12, None)]
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> np.ma.notmasked_contiguous(ma, axis=0)
    [[slice(0, 1, None), slice(2, 3, None)], [], [slice(0, 1, None)], [slice(0, 3, None)]]
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> np.ma.notmasked_contiguous(ma, axis=1)
    [[slice(0, 1, None), slice(2, 4, None)], [slice(3, 4, None)], [slice(0, 1, None), slice(3, 4, None)]]
=== detect
numpydoc
=== compose numpydoc
Find contiguous unmasked data in a masked array along the given axis.

Parameters
----------
a : array_like
    The input array.
axis : int, optional
    Axis along which to perform the operation.
    If None (default), applies to a flattened version of the array, and this
    is the same as `flatnotmasked_contiguous`.

Returns
-------
endpoints : list
    A list of slices (start and end indexes) of unmasked indexes
    in the array.

    If the input is 2d and axis is specified, the result is a list of lists.

See Also
--------
flatnotmasked_edges, flatnotmasked_contiguous, notmasked_edges
clump_masked, clump_unmasked

Notes
-----
Only accepts 2-D arrays at most.

Examples
--------
>>> import numpy as np
>>> a = np.arange(12).reshape((3, 4))
>>> mask = np.zeros_like(a)
>>> mask[1:, :-1] = 1; mask[0, 1] = 1; mask[-1, 0] = 0
>>> ma = np.ma.array(a, mask=mask)
>>> ma
masked_array(
  data=[[0, --, 2, 3],
        [--, --, --, 7],
        [8, --, --, 11]],
  mask=[[False,  True, False, False],
        [ True,  True,  True, False],
        [False,  True,  True, False]],
  fill_value=999999)
>>> np.array(ma[~ma.mask])
array([ 0,  2,  3,  7, 8, 11])
>>> np.ma.notmasked_contiguous(ma)
[slice(0, 1, None), slice(2, 4, None), slice(7, 9, None), slice(11, 12, None)]
>>> np.ma.notmasked_contiguous(ma, axis=0)
[[slice(0, 1, None), slice(2, 3, None)], [], [slice(0, 1, None)], [slice(0, 3, None)]]
>>> np.ma.notmasked_contiguous(ma, axis=1)
[[slice(0, 1, None), slice(2, 4, None)], [slice(3, 4, None)], [slice(0, 1, None), slice(3, 4, None)]]
