I try to sort dataframe shown below by date using df.sort_values(by=\'date\') however it doesn\'t work. Any ideas how can I do this to be sure that it is sorted
df.sort_values(by=\'date\')
Try
df['Date']=pd.to_datetime(df.Date) df.sort_values(['Date'])