How to visualisate hierarchical structure df with python?

Viewed 33
import pandas as pd

df = pd.read_csv("StudentsPerformance.csv")

df.lunch.value_counts(normalize=True)['free/reduced']

res = df.groupby("lunch", as_index=True).agg(["mean", "var"]).rename(columns={"math score": "math", "reading score": "reading", "writing score":"writing"})

I have tried making histograms from the table results in a variable "res" like that hists:

enter image description here

But apparently due to the hierarchical structure, it was not possible to make the same histograms. Please tell me how to hand it over?

0 Answers
Related