def nearestPosition(array, value):
difference_list = abs(array - value)<EOL>return difference_list.argmin()<EOL>
return the index of that value that is most similar in the array
needs a numpy.1darray

>>> import numpy
>>> a = numpy.array([1,2,3,7,3,647,223,777])
>>> nearestPosition(a, 22)
3
>>> nearestPosition(a, 300)
6