I have a result from an API call that comes in and looks like this:
dict1 = {"label": 'LABEL_0', 'score': 0.85}
dict2 = {"label": 'LABEL_1', 'score': 0.10}
dict3 = {"label": 'LABEL_2', 'score': 0.10}
list([dict1, dict2, dict3])
[{'label': 'LABEL_0', 'score': 0.85},
{'label': 'LABEL_1', 'score': 0.1},
{'label': 'LABEL_2', 'score': 0.1}]
How would I get the label with the max label and the score associated as two variables?
So for this example I would want e.g. want
label_val = "LABEL_0"
score_val = 0.85
I cant figure out a way of doing this. I tried un-listing using the * but that did not help