I used seaborn to get a barchart where my data is counted by the column MONTH
.
sns.catplot(x = 'MONTH',kind="count",data=df)
What I now wanted to get is a stacked barchart where the data is counted by another column TASKTYPE
. The entries in this column are strings.
My dataframe looks like this:
MONTH TASKTYPE
09/19 A
09/19 B
10/19 B
10/19 B
01/20 A
I now want to get a stacked bar chart with MONTH
on the x-axis, count
on y-axis and the bars stacked by TASKTYPE
. I think I could do something like this using pandas.
How could I do this?
question from:
https://stackoverflow.com/questions/66061962/stacked-bar-chart-count-by-a-certain-column-which-contains-string-values 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…