smpl_util.util.find_nearest

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

Return the element in array closest to value

Examples

>>> find_nearest([1,7,6,2] , 1.9)
2