Skip to content

Commit cd1efc3

Browse files
Merge pull request #229 from cognizant-ai-labs/scenario_generator
Minor change to scenario generator
2 parents edd95a4 + f193b21 commit cd1efc3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

covid_xprize/validation/scenario_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ 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))

0 commit comments

Comments
 (0)