Python: Find index of minimum item in list of floats [duplicate]
问题 This question already has answers here : Getting the index of the returned max or min item using max()/min() on a list (22 answers) Closed 4 years ago . How can I find the index of the minimum item in a Python list of floats? If they were integers, I would simply do: minIndex = myList.index(min(myList)) However, with a list of floats I get the following error, I assume because float equality comparison is rather iffy. ValueError: 0.13417985135 is not in list Now, I know that I could simply