I have the following dataframe for my experiment result :
How can I reshape it to look like this table :
I have the following dataframe for my experiment result :
How can I reshape it to look like this table :
Based on the data you've provided you should be able to use .unstack()
to do this:
print(df['counts'].unstack(level=['Model_1', 'Winloss']))