I have a Pandas dataframe (1800 obs) that looks something like this:
A B C D
1 CL0 CL1 CL2 CL0
2 CL2 CL1 CL1 CL3
3 CL3 CL2 CL0 CL1
. ... ... ... ...
. ... ... ... ...
n CL2 CL1 CL0 CL3
I want to create a stacked bar chart that will have columns 'A', 'B', 'C', 'D' on the x axis, and the percentage of each level in that feature on the y axis. Something like the picture below.
I'm guessing I need to tabulate the data somehow? But I don't know how to do this.