I have a Dataframe with the columns state and runtime
id state runtime
1 successful 25
2 successful 30
3 failed 30
4 failed 35
I want to calculate a success rate for every runtime in a new dataframe to plot the data later.
Success rate is successful projects divided by all projects
runtime success_rate
25 1
30 0.5
35 1