If I have 2 lists:
values = ['a', 'b', 'c', 'd']
accuracies = [1, 2, 3, 4]
I want to return the value in values when its corresponding accuracy in accuracies is the biggest.
In this case, the result of value should be 'd'
, because its corresponding accuracy is 4
.
Is there a way to do it in python?
Thank you in advance.
Use this:
In [5]: values[accuracies.index(max(accuracies))]
Out[5]: 'd'