UPDATED to include a sample of the data:
I have a bar graph that takes the data I have, grouped by starting location (five boroughs of NYC), ad then within that, grouped by data of two different companies X and Y.
As of now the data shows 10 bars all separated equally (each borough and each company), and instead I want it to have 10 bars, but each borough sticks both companies together, so that I have 5 different sections, instead of 10.
Also, I would like to show the percentage overall within the bars if possible, but I don't know how to design it as such.
Lastly, what method would I use to add titles to the axis within the code?
I'm relatively new to Jupyter Notebooks and Data Analytics, so any help would be greatly appreciated, thank you so much!
(Note: It's not actually the five boroughs, but it's close enough - that's just for the purposes of the explanation, as the solution would be the same.)
My current code and graph:
df_stacked = df.groupby(['Starting Location', 'Company Chosen']).count()
# df_stacked['Customer_ID'].plot(kind = 'bar', stacks = df['BREAKDOWN', SUCCESSFUL TRIP])
df_stacked.drop(df_stacked.columns.difference(['Unavailable Scooter', 'BREAKDOWN', 'Successful Trip']), 1, inplace = True)
df_stacked.plot.bar(stacked = True, figsize = (10, 5))