argclosest

typhon.math.array.argclosest(array, value, retvalue=False)[source]

Returns the index of the closest value in array.

Parameters
  • array (ndarray) – Input array.

  • value (float) – Value to compare to.

  • retvalue (bool) – If True, return the index and the closest value.

Returns

Index of closest value, Closest value (if retvalue is True)

Return type

int, float