From 544916164fb145cde3147315da9692e0b29283f7 Mon Sep 17 00:00:00 2001 From: Joakim Pettersson Date: Tue, 15 Oct 2024 10:24:18 +0200 Subject: [PATCH] Speedup read_excel for SMHI data #682 #682 Use openpyxl to read SMHI data. Note: calamine is only 15% faster which is not worth an additional dependency. --- data/issues/emissions/historical_data_calculations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/issues/emissions/historical_data_calculations.py b/data/issues/emissions/historical_data_calculations.py index 764975db..81d998d9 100644 --- a/data/issues/emissions/historical_data_calculations.py +++ b/data/issues/emissions/historical_data_calculations.py @@ -15,7 +15,7 @@ def get_smhi_data(path=PATH_SMHI): pandas.DataFrame: The dataframe containing the SMHI data. """ - df_raw = pd.read_excel(PATH_SMHI) + df_raw = pd.read_excel(path, engine="openpyxl") # Remove the first 4 rows and reset the index df_raw = df_raw.drop([0, 1, 2]).reset_index(drop=True)