I am trying to sort some data using Python/Pandas by year and month for a line plot.
My code is:
df.groupby(df['EXTRACT_DATE'].dt.strftime('%Y-%m'))['data'].sum().sort_values(ascending=True)
Which is returning:
Which is clearly not in order, but I'm not sure why and my data is like this:

