I am trying to make a grouped bar chart in python for a dataframe that looks like this:
| age | sex | target |
|---|---|---|
| 25 | m | 0 |
| 33 | f | 0 |
| 20 | m | 1 |
| 37 | f | 1 |
| 40 | f | 1 |
[this is what I want it to look like. One chart for sex and another chart for age. ][1] [1]: https://i.stack.imgur.com/NgFUE.jpg
This is what I've tried so far but it didn't return what I wanted:
df.groupby('sex')[target].value_counts().plot.bar(legend=True)
Thanks.
