Reputation: 81
I have the following dataFrame:
Score
one A 8
B 19
D 29
two C 18
A 10
B 4
D 2
six C 4
A 4
B 4
And I wish to create one bar plot where X axis values are "one", "two" and "six", and each value has 4 bars (A,B,C,D) when the bar height determined by the score column.
Thank you. Nastya
Upvotes: 2
Views: 73
Reputation: 862521
You need unstack
for reshaping with DataFrame.plot.bar
:
import matplotlib.pyplot as plt
df.unstack()['Score'].plot.bar()
plt.show()
Upvotes: 2