|
10 | 10 | add_prefix,
|
11 | 11 | create_export_csv,
|
12 | 12 | GeoMapper,
|
13 |
| - NAN_CODES, |
| 13 | + Nans, |
14 | 14 | )
|
15 | 15 |
|
16 | 16 | from .constants import HOME_DWELL, COMPLETELY_HOME, FULL_TIME_WORK, PART_TIME_WORK, GEO_RESOLUTIONS
|
@@ -220,19 +220,19 @@ def process_window(df_list: List[pd.DataFrame],
|
220 | 220 | df_export["timestamp"] = date.strftime('%Y%m%d')
|
221 | 221 |
|
222 | 222 | # Default missingness codes
|
223 |
| - df_export["missing_val"] = NAN_CODES["Not Missing"] |
224 |
| - df_export["missing_se"] = NAN_CODES["Not Missing"] |
| 223 | + df_export["missing_val"] = Nans.NOT_MISSING |
| 224 | + df_export["missing_se"] = Nans.NOT_MISSING |
225 | 225 | # Sample size will never be missing in this indicator
|
226 | 226 | # since sample_size just counts the presence of rows for a geo region
|
227 |
| - df_export["missing_sample_size"] = NAN_CODES["Not Missing"] |
| 227 | + df_export["missing_sample_size"] = Nans.NOT_MISSING |
228 | 228 | # Add missingness codes as detected
|
229 | 229 | # This may occur if all the values are missing for a geographic region
|
230 | 230 | remaining_nans_mask = df_export["val"].isnull()
|
231 |
| - df_export.loc[remaining_nans_mask, "missing_val"] = NAN_CODES["Unknown"] |
| 231 | + df_export.loc[remaining_nans_mask, "missing_val"] = Nans.UNKNOWN |
232 | 232 | # This may occur if all the values are missing for a geographic region
|
233 | 233 | # or if the sample size is 1
|
234 | 234 | remaining_nans_mask = df_export["se"].isnull()
|
235 |
| - df_export.loc[remaining_nans_mask, "missing_se"] = NAN_CODES["Data Insufficient"] |
| 235 | + df_export.loc[remaining_nans_mask, "missing_se"] = Nans.DATA_INSUFFICIENT |
236 | 236 |
|
237 | 237 | create_export_csv(df_export,
|
238 | 238 | export_dir,
|
|
0 commit comments