Let's say I have the following dataframe with two columns: label: can be -1, 0 or 1. years_of_expereicen: can be 0,1,2,3,4,5,6,7,8,9
label SSP_years_of_experience
22640 -1.0 5.0
181487 1.0 3.0
327672 0.0 9.0
254919 0.0 6.0
136942 1.0 10.0
My goal here is to use this dataframe to create a percentage stacked barchart where the x-axis is years of experience and the bars are different colors each consisting of one years of experience value. In other words, we have 10 possible values on the x-axis and then three bars for each value of different colors that map to each of the labels. The y-axis should be in percent.
I would knoew how to do this in R (with ggplot), but I'm new to matplotlib and somewhat new to python.
Bonus points where I can pass in the two columns as variables (eg. x,y). MOre bonus points for how to display the number of observations in each bar as text in the chart.