Skip to content

Commit f193b21

Browse files
oops; the RegionName must be filled in before it is first used
1 parent 0ae8827 commit f193b21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

covid_xprize/validation/scenario_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ def generate_scenario(start_date_str,
118118
if countries:
119119
ips_df = ips_df[ips_df.CountryName.isin(countries)]
120120

121+
# Use a value instead of NaN for missing RegionName.
122+
ips_df['RegionName'] = ips_df['RegionName'].fillna("")
123+
121124
# Fill any missing "supposedly known" NPIs by assuming they are the same as previous day, or 0 if none is available
122125
for npi_col in npi_columns:
123126
ips_df.update(ips_df.groupby(['CountryName', 'RegionName'], group_keys=False)[npi_col].ffill().fillna(0))
124127

125-
# Use a value instead of NaN for missing RegionName.
126-
ips_df['RegionName'] = ips_df['RegionName'].fillna("")
127-
128128
if scenario == "Historical":
129129
return ips_df
130130

0 commit comments

Comments
 (0)