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