use the ways as described in stackoverflow from google search
or
simply use describe:
df.groupby([col1, col2]).describe(percentiles=[.75, .95])
Optionally, you may wanna have the aggregated value display horizontally and round the numbers by appending:
df.groupby([col1, col2]).describe(percentiles=[.75, .95]).unstack().apply(lambda x:np.round(x,0))
No comments:
Post a Comment