I want to calculate the median for the waiting based on the column kind of this data frame, then display them as
kind median
short 55.5
long 81.5
instead I'm getting this
5 55.5
15 55.5
17 81.5
24 81.5
37 81.5
39 81.5
46 55.5
50 81.5
53 81.5
55 81.5
65 81.5
this code is creating this result:
median= df(['kind'])['waiting'].transform('median')
I really just want a single line for each long and short, and for it to be automated.
