Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get index of closest value in list python

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