I have a DataFrame that I\'m looking to use a groupby on but I\'m looking for a little bit of an unusual function to aggregate with. I would like to get the per
groupby
>>> df.groupby('day')['value'].apply(lambda c: (c>0).sum()/len(c)) day 1 0.333333 2 0.666667 3 0.333333 4 1.000000 Name: value, dtype: float64