grouping in pandas and getting percetile values code example Example: pandas groupby percentile df.groupby('C').quantile(.95)