Reputation: 752
I have a data frame that looks something like this.
print (df)
a b
0 1 5896
1 1 4000
2 1 89647
3 2 54
4 2 3568
5 2 48761
6 3 5896
7 3 2800
8 3 5894
And I want to make a bar plot. That looks like this.
I tried with groupby.()
but it only prints only one value of 1 one values of 2 etc...
a = df_result.groupby(['column1'])['column2'].mean()
a.plot.bar()
plt.show()
Would appreciate some guidance how to solve the problem, so I would have all of the values in a chart.
Upvotes: 1
Views: 120