My input dataframe is;
Grp A B C
Men 10 15 20
Women 15 10 25
Baby 5 10 20
Men 3 8 25
Men 7 5 30
Baby 5 2 8
Women 10 6 3
How can i get this upper and lower fences for unique groups?
Desired Output is;
GRP Upper_A Lower_A Upper_B Lower_B Upper_C Lower_C
Men
Women
Baby
Could you please help me about this? PS: Upper and lower values are box and whisker values.
Use
GroupBy.agg
withSeries.quantile
, specify new columns names and then flatten MultiIndex byf-string
s: