When I apply the kurtosis function on a pandas datafame I always get following error: "AttributeError: Cannot access callable attribute 'kurt' of 'DataFrameGroupBy' objects, try using the 'apply' method". The following sample code works with all other statistical functions (mean(), skew(), ...), but not with kurtosis.
df = pd.DataFrame([[0,1,1,0,0,1],[0,1,2,4,5]]).T
df.columns = ['a','b']
df.groupby('a').kurt()
Any idea how I can apply kurtosis after groupby ? Thanks !