SyntaxFix
Write A Post
Hire A Developer
Questions
You can simply use value_counts with sort option set to False. This will preserve ordering of the categories
value_counts
sort
False
df['colour'].value_counts(sort=False).plot.bar(rot=0)