From e2641fe2a6771a3272bb309a7f889386b46f98a5 Mon Sep 17 00:00:00 2001 From: Lucas Merrill Brown Date: Fri, 7 Oct 2022 11:28:11 -0400 Subject: [PATCH] Issue 1992: Do not impute income for null population tracts (#1993) --- .../data_pipeline/etl/sources/census_acs/etl_imputations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl_imputations.py b/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl_imputations.py index e9e741d7..e3d52988 100644 --- a/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl_imputations.py +++ b/data/data-pipeline/data_pipeline/etl/sources/census_acs/etl_imputations.py @@ -76,10 +76,10 @@ def _prepare_dataframe_for_imputation( # First, check whether any of the columns we want to impute contain null # values geo_df[imputing_cols].isna().any(axis=1) - # Second, ensure population is either null or >= the minimum population + # Second, ensure population is not null and >= the minimum population & ( - geo_df[population_field].isnull() - | ( + geo_df[population_field].notnull() + & ( geo_df[population_field] >= minimum_population_required_for_imputation )