Add FEMA risk index to score file (#687)

* Add to score file
This commit is contained in:
Lucas Merrill Brown 2021-09-15 13:31:32 -05:00 committed by GitHub
commit 1c0d87d84b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 12 deletions

View file

@ -62,12 +62,16 @@ class DOEEnergyBurden(ExtractTransformLoad):
)
# Convert energy burden to a fraction, since we represent all other percentages as fractions.
output_df[self.ENERGY_BURDEN_FIELD_NAME] = output_df[self.ENERGY_BURDEN_FIELD_NAME] / 100
output_df[self.ENERGY_BURDEN_FIELD_NAME] = (
output_df[self.ENERGY_BURDEN_FIELD_NAME] / 100
)
# Left-pad the tracts with 0s
expected_length_of_census_tract_field = 11
output_df[self.GEOID_TRACT_FIELD_NAME] = output_df[self.GEOID_TRACT_FIELD_NAME].astype(str).apply(
lambda x: x.zfill(expected_length_of_census_tract_field)
output_df[self.GEOID_TRACT_FIELD_NAME] = (
output_df[self.GEOID_TRACT_FIELD_NAME]
.astype(str)
.apply(lambda x: x.zfill(expected_length_of_census_tract_field))
)
self.output_df = output_df