This is unique as I want the stacked bar chart to reflect the actual numeric value, not counts or size as per examples
I have a dataframe
## create Data frame
DF = pd.DataFrame({ 'name':
['AA6','B7Y','CCY','AA6','B7Y','CCY','AA6','B7Y','CCY','AA6'],
'measure': [3.2,4.2,6.8,5.6,3.1,4.8,8.8,3.0,1.9,2.1]})
I want to groupby name
#Create a groupby object
gb=DF.groupby(['name', 'measure'])
gb.aggregate('sum')
And then plot a bar chart of the three categories in name(AA6, B7Y & CCY) with each of the corresponding 'measure' values stacked, and in the order they are in (not in ascending order that they appear above)
I have tried this:
DF.groupby('name').plot(kind='bar', stacked=True)
But it just creates separate plots.