nearest_idx

nrv.utils.nearest_idx(array: ndarray[tuple[Any, ...], dtype[_ScalarT]], val: float) int[source]

Return index of neareast value

Parameters:
  • array (NDArray) – array of values

  • val (float) – neareast value to find index

Returns:

index of the neareast value

Return type:

int