Skip to content

Commit

Permalink
Remove no-op lines from tiles (#1848)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbowen-usds committed Aug 30, 2022
1 parent 1c3389a commit ca22fdb
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions data/data-pipeline/data_pipeline/etl/score/etl_score_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,33 +219,8 @@ def _create_score_data(
right_on=self.STATE_CODE_COLUMN,
how="left",
)

# check if there are census tracts without score
logger.info("Removing tract rows without score")

# merge census tracts with score
merged_df = national_tract_df.merge(
score_county_state_merged,
on=self.GEOID_TRACT_FIELD_NAME,
how="left",
)

# recast population to integer
score_county_state_merged["Total population"] = (
merged_df["Total population"].fillna(0).astype(int)
)

de_duplicated_df = merged_df.dropna(
subset=[DISADVANTAGED_COMMUNITIES_FIELD]
)

# recast threshold count to integer
de_duplicated_df[field_names.THRESHOLD_COUNT] = de_duplicated_df[
field_names.THRESHOLD_COUNT
].astype(int)

# set the score to the new df
return de_duplicated_df
return score_county_state_merged

def _create_tile_data(
self,
Expand Down

0 comments on commit ca22fdb

Please sign in to comment.