find_nan_indices

find_nan_indices(arr: ndarray, obs_axis: int) tuple[source][source]

Find the indices of rows with and without NaN values

Parameters:
  • arr (array) – The data to find indices.

  • obs_axis (int) – The axis along which to apply func.

Returns:

A tuple of two arrays containing the indices of rows with and without NaN values.

Return type:

tuple

Examples

>>> arr = np.array([[1, 2], [4, 5], [7, 8],
... [float("nan"), float("nan")]])
>>> find_nan_indices(arr, 0)
(array([3]... array([0, 1, 2]...)