Pandas's pivot_table() can be used to create a spreadsheet-style pivot table as a DataFrame. Check the list of parameters of this function by clicking on the link with pivot_table.
To create a pivot table using your data, in the function, use the column "probs" for parameter values, column "fracs" for parameter index, and a list of sum and mean functions for parameter aggfunc. You don't need to specify the value for parameter columns.
You can try the following code:
import pandas as pd
import numpy as np
fracs = np.concatenate([[0.1]*5, [0.20]*5, [0.3]*5])
probs = np.random.random(15)
iters = np.asarray([i for i in range(5)]*3)
df = pd.DataFrame({"fracs":fracs, "iters":iters, "probs":probs})
# create pivtor table with average probability for each fraction
df1 = pd.pivot_table(df, values="probs", index="fracs", aggfunc=[np.sum, np.mean])
print(df1)
The above code will print the following output:
sum mean
probs probs
fracs
0.1 3.808452 0.761690
0.2 2.262392 0.452478
0.3 2.017160 0.403432