I have a data frame that looks something like this and I want am trying to make two grouped bar charts where one is grouped by sex and it shows the counts for the disease for males and females:
| Age | Sex | disease |
|---|---|---|
| 23 | m | 0 |
| 43 | m | 1 |
| 32 | f | 0 |
| 51 | f | 1 |
| 29 | m | 1 |
This is what ive tried but it shows every datapoint instead of the total counts.
heart_failure_df.set_index(['Sex']).plot(y='disease', kind="bar")
This is ideally what i want:

