Sorting a pandas dataframe by its index January 1, 2024 by Tarik I think you need sort_index: all_data = all_data.sort_index()