I would like to create multiple pie charts from a pivot_table on streamlit probably using matplotlib

The pivot table has 4 age categories as the index and two columns containing count of males for each category and count of females for that category

image

Steps to reproduce

st.header('Age Category Per Gender')
ageCatPerGenderTable = df.assign(count=1).pivot_table(index='Age Category', columns = 'Gender', 
values='count', aggfunc='sum', fill_value=0)
st.dataframe(ageCatPerGenderTable)

I would like to represent pivot table as four pie charts, one for each age category with the breakdown of genders for each with a percentage and count as labels.

I’m a beginner with streamlit, python and matplotlib.

Hey @sskk,

Have you tried using Matplotlib’s pie method?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.