Skip to content

Commit

Permalink
Speedup read_excel for SMHI data Klimatbyran#682
Browse files Browse the repository at this point in the history
This shaved off 6 seconds from the test.

* Use calamine when importing SMHI data
  • Loading branch information
joakimbits committed Sep 19, 2024
1 parent 28138b8 commit 216339e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions 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 @@ -12,7 +12,7 @@ def get_smhi_data():
pandas.DataFrame: The dataframe containing the SMHI data.
"""

df_raw = pd.read_excel(PATH_SMHI)
df_raw = pd.read_excel(PATH_SMHI, engine="calamine")

# Remove the first 4 rows and reset the index
df_raw = df_raw.drop([0, 1, 2]).reset_index(drop=True)
Expand Down
1 change: 1 addition & 0 deletions data/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ scipy
pytest
pytest-profiling
graphviz
python-calamine

0 comments on commit 216339e

Please sign in to comment.