mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 01:54:18 -08:00
Backfill population in island areas (#1882)
This commit is contained in:
parent
9fb9874a15
commit
8e4f80b8c5
1 changed files with 16 additions and 0 deletions
|
@ -634,8 +634,24 @@ class ScoreETL(ExtractTransformLoad):
|
|||
]
|
||||
].mean(axis=1, skipna=True)
|
||||
|
||||
# For AS, MP, GU, and VI, backfill data from the 2010 census where we have it
|
||||
df_copy = self._backfill_island_data(df_copy)
|
||||
|
||||
return df_copy
|
||||
|
||||
@staticmethod
|
||||
def _backfill_island_data(df: pd.DataFrame) -> pd.DataFrame:
|
||||
logger.info("Backfilling island data")
|
||||
island_index = (
|
||||
df[field_names.GEOID_TRACT_FIELD]
|
||||
.str[:2]
|
||||
.isin(constants.TILES_ISLAND_AREA_FIPS_CODES)
|
||||
)
|
||||
df.loc[island_index, field_names.TOTAL_POP_FIELD] = df.loc[
|
||||
island_index, field_names.COMBINED_CENSUS_TOTAL_POPULATION_2010
|
||||
]
|
||||
return df
|
||||
|
||||
def transform(self) -> None:
|
||||
logger.info("Transforming Score Data")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue