Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python find index of closest value in list

min(range(len(a)), key=lambda i: abs(a[i]-11.5))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #find #index #closest #list
ADD COMMENT
Topic
Name
5+9 =