How, can I sort this plot to show from biggest to lowest? I tried to use sort_values but does not work
plt.figure(figsize=(15,8))
sns.countplot(x='arrival_date_month',data=df.sort_values('arrival_date_month',ascending=False))
plt.xticks(rotation=45)
CodePudding user response:
The default ordering for a column of type string is the order of occurrence in the dataframe.
You can set a fixed order, either by using the order=
keyword, or by making the column