f = pd.DataFrame({"value": [2, 3, 1], "date": ["2019-3-18", "2019-10-24", "2019-1-1"]}) df["date"] = pd.to_datetime(df["date"]) df = df.sort_values(by="date")