DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
5+9 =
Submit