Is there a numpy-thonic way, e.g. function, to find the nearest value in an array?
Example:
np.find_nearest( array, value )
Maybe helpful for ndarrays:
ndarrays
def find_nearest(X, value): return X[np.unravel_index(np.argmin(np.abs(X - value)), X.shape)]