Я использовал pandas для построения графика.
import pandas as pd
# Barchart to show the relationship between age group and total
df.plot.bar(x='age_group', y='total', rot=0)
# Barchart to show the relationship between different gender and total
df.plot.bar(x='age_group', y=['female', 'male'], rot=0)