nearest_index

support.nearest_index(np_array, value)

Return the index of the element of the array with the nearest value

Note

This has a problem with arrays of datetime.datetime() objects.

:param np_array : an array of value :type np_array : numpy array

:param value : a single value :type value : the same type as values in np_array

return

index of item in np_array closest to value