skrf.util.find_nearest

skrf.util.find_nearest(array, value)[source]

find nearest value in array.

taken from http://stackoverflow.com/questions/2566412/find-nearest-value-in-numpy-array

Parameters:
  • array (numpy.ndarray) – array we are searching for a value in
  • value (element of the array) – value to search for
Returns:

found_value – the value that is numerically closest to value

Return type:

an element of the array