Find nearest value in numpy array
Asked 07 September, 2021
Viewed 809 times
  • 64
Votes

Is there a numpy-thonic way, e.g. function, to find the nearest value in an array?

Example:

np.find_nearest( array, value )

18 Answer