Skip to content

Commit

Permalink
Speedup read_excel for SMHI data #682 #682
Browse files Browse the repository at this point in the history
Use openpyxl to read SMHI data.

Note: calamine is only 15% faster which is not worth an additional dependency.
  • Loading branch information
joakimbits committed Oct 15, 2024
1 parent b39530e commit 5449161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/issues/emissions/historical_data_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5449161

Please sign in to comment.