From 9e4197638fe3a7874e8569fb46a32ec03b7e6db8 Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Tue, 7 Nov 2023 13:32:14 +0000 Subject: [PATCH] Switch sorting method for new pandas version --- docs/demo/scripts/oxford_demo.py | 2 +- wsimod/demo/create_oxford.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo/scripts/oxford_demo.py b/docs/demo/scripts/oxford_demo.py index c64c8349..129ee18d 100644 --- a/docs/demo/scripts/oxford_demo.py +++ b/docs/demo/scripts/oxford_demo.py @@ -123,7 +123,7 @@ dates = input_data.date.unique() -dates.sort() +dates = dates[dates.argsort()] dates = [pd.Timestamp(x) for x in dates] print(dates[0:10]) # %% [markdown] diff --git a/wsimod/demo/create_oxford.py b/wsimod/demo/create_oxford.py index bd04bf03..80fc0dbb 100644 --- a/wsimod/demo/create_oxford.py +++ b/wsimod/demo/create_oxford.py @@ -168,7 +168,7 @@ def create_oxford_model(data_folder): .to_dict() ) dates = input_data.date.unique() - dates.sort() + dates = dates[dates.argsort()] dates = [pd.Timestamp(x) for x in dates] constants.POLLUTANTS = input_data.variable.unique().tolist() constants.POLLUTANTS.remove("flow")