figured it out:
k = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
dayWeek = sorted(dayWeek, key=k.index)
You can use the order parameter of countplot like this:
sns.countplot(y='DOW',order=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], data=df, palette='viridis')
where DOW
is my dayofweek
column.
I also noticed that by not mentioning a day, you can omit that day being displayed in the chart.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.