Skip to content

Commit

Permalink
Merge pull request #31 from OCHA-DAP/hotfix/type-convert
Browse files Browse the repository at this point in the history
hotfix data type conversion
  • Loading branch information
hannahker authored Dec 2, 2024
2 parents d9ff918 + 8283d71 commit 06ba364
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 4 deletions.
4 changes: 3 additions & 1 deletion assets/geo/adm0.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion assets/geo/adm0_outline.json

Large diffs are not rendered by default.

31 changes: 30 additions & 1 deletion assets/geo/adm1.json

Large diffs are not rendered by default.

155 changes: 154 additions & 1 deletion assets/geo/adm2.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pandas as pd
from sqlalchemy import text

from utils.log_utils import get_logger

logger = get_logger("data")
Expand Down Expand Up @@ -34,6 +35,7 @@ def process_flood_data(df_exposure, pcode, adm_level, window=7):
val_col = f"roll{window}"

# Calculate seasonal averages
df_exposure["date"] = pd.to_datetime(df_exposure["date"])
df_seasonal = (
df_exposure[df_exposure["date"].dt.year < 2024]
.groupby(["adm1_pcode", "adm2_pcode", "dayofyear"])[val_col]
Expand Down

0 comments on commit 06ba364

Please sign in to comment.