I have a pd DataFrame df with the following format:
model auc p r
`a-num5-run1` 0.9 0.8 1.0
`a-num5-run2` 0.8 0.7 0.9
`b-num5-run1` 0.7 0.6 0.8
`b-num5-run2` 0.6 0.5 0.7
`a-num10-run1` 0.5 0.4 0.6
`a-num10-run2` 0.4 0.3 0.5
`b-num10-run1` 0.3 0.2 0.4
`b-num10-run2` 0.2 0.1 0.3
....
`a-num100-run1` 0.8 0.9 0.7
`a-num100-run2` 0.6 0.7 0.4
`a-num100-run1` 0.4 0.5 0.1
`a-num100-run2` 0.2 0.3 0.8
The model column shows the dimensions in which each model can be distinguished.
Now, I would like to create a DataFrame in which the values per column are averaged over their runs and stored in a tuple, each number is a column and each row is a model (a or b in this case). The desired result would be the matrix as shown below:
model_name 5 10 ... 100
a (0.85, 0.75, 0.95) (0.45, 0.35, 0.55) ... (0.7, 0.8, 0.55)
b (0.65, 0.55, 0.75) (0.25, 0.15, 0.35) ... (0.3, 0.4, 0.45)
How can I do this?