pandas groupby aggregate quantile
# 50th Percentile
def q50(x):
return x.quantile(0.5)
# 90th Percentile
def q90(x):
return x.quantile(0.9)
my_DataFrame.groupby(['AGGREGATE']).agg({'MY_COLUMN': [q50, q90, 'max']})
3.71
9
df.groupby('C').quantile(.95)
Thank you!
9
0
Are there any code examples left?
New code examples in category Python