I created a chart in matplotlib using python and the x-axis is the days of the week (Mon-Sun). When the data was plotted though, the x-axis is not arranged Mon-Sun.
Is there way I can re-order the x-axis to have it be formatted this way?
or is there a way I can re-order the dataset? It is a csv file that is being read using the panda dataframe
Example Data: (lives in csv: './data/Days_Summary.csv')
Day Value
Monday 56
Tuesday 23
Wednesday 34
Thursday 56
Friday 58
Saturday 70
Sunday 43
Code:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df=pd.read_csv('./data/Days_Summary.csv')
days_values=df.groupby(['day'])['day'].count().plot(kind='bar')
plt.xlabel('Day')
plt.ylabel('Values')
plt.show()