Skip to content

Commit 0ae8827

Browse files
scenario generator should handle NaN values present in the raw dataframe it accepts as input
1 parent 14cd81a commit 0ae8827

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
@@ -122,6 +122,9 @@ def generate_scenario(start_date_str,
122122
for npi_col in npi_columns:
123123
ips_df.update(ips_df.groupby(['CountryName', 'RegionName'], group_keys=False)[npi_col].ffill().fillna(0))
124124

125+
# Use a value instead of NaN for missing RegionName.
126+
ips_df['RegionName'] = ips_df['RegionName'].fillna("")
127+
125128
if scenario == "Historical":
126129
return ips_df
127130

0 commit comments

Comments
 (0)