Reputation: 457
How to order the bars in the frequency plot in the order of 0,1,2,3,4 instead of the highest frequency as shown in the below picture?
This is the code i used:
train_df.Fedu.value_counts().plot(kind='bar', alpha=0.6)
plt.title("Distribution of Father's education")
Upvotes: 1
Views: 165
Reputation: 153540
Use sort_index
:
train_df.Fedu.value_counts().sort_index().plot(kind='bar')
Upvotes: 2