I have a dataframe:
id is_good
a1 1
a1 1
a1 0
bb 1
bb 0
bb 0
bb 0
I want to count percentage of 0 and 1 for each id. So desired result is:
id is_good_perc
a1 0.67
bb 0.25
How to do that? What should I do after groupby("id")
?