Skip to content

Commit 339c8a1

Browse files
committed
debug get_season
1 parent 71c89c5 commit 339c8a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

python/common/recluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,10 @@ def ui_related_var_modifications(df: pd.DataFrame, seasons_and_months: dict, DEP
476476
pd.DataFrame: clusters with ui related variables
477477
"""
478478
df["tst_median"] = pd.to_datetime(df["tst_median"], format="%Y-%m-%d %H:%M:%S", errors="coerce")
479+
print(df["tst_median"])
479480
df["year"] = df["tst_median"].dt.year
480481
df["season"] = df["tst_median"].dt.month.map(lambda x: get_season(x, seasons_and_months))
481-
482+
print(df["season"])
482483
for k, v in DCLASS_NAMES.items():
483484
df["dclass"] = df["dclass"].replace(k, v)
484485

python/common/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def get_target_oday(offset=1):
5353
return start_date
5454

5555
def get_season(month, seasons_and_months):
56+
print(month)
57+
print(seasons_and_months)
58+
if month is None:
59+
return None
60+
5661
key = [key for key, val in seasons_and_months.items() if month in val][0]
5762
return key.lower()
5863

0 commit comments

Comments
 (0)