carat.util.find_nearest

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

Find index of the nearest value of an array to a given value

Parameters:
array (numpy.ndarray) : array
value (float) : value
Returns:
idx (int) : index of nearest value in the array