It's probably pretty obvious in the end but I cannot think of a way to do this. Thanks for your help!
I did a prediction task and as a result I have a DataFrame with the percentages and a column with the predicted class, like so:
Class1 Class2 Class3 Prediction 0 0.99 0.01 0.00 Class1 1 0.15 0.14 0.71 Class3 2 0.05 0.80 0.15 Class2 Now I want to access the probability with which a class was predicted. So I want to have a list like below so I can work with it further.
0 0.99 1 0.71 2 0.80 I have problems finding a way to access only one value of df.Predicted at a time and have no idea how to search for it. How do I get this value or alternatively my desired list? I tried this:
values = [] for row in df.Predicted: values.append(row) print(values) but it returns the whole column for each iteration. It also doesn't feel very pandas-like. I am using python 3.5 in case it makes a difference