Skip to content Skip to sidebar Skip to footer

Matplotlib Bar Chart That Displays The X Values For Male And Females

I want to try analyse the distribution of marital status by gender and I feel a bar chart is the best to way to go. I can figure out how to get the number of people per marital sta

Solution 1:

This should help:

gender_column = <ENTER GENDER COLUMN NAME HERE>
dfFile.groupby(["marital_status", gender_column]).size().unstack(level=1).plot(kind='bar')

Post a Comment for "Matplotlib Bar Chart That Displays The X Values For Male And Females"