Skip to content

Commit

Permalink
update CenSus_ACS units to USD, p, and Percent, and add additional cl…
Browse files Browse the repository at this point in the history
…ass Money
  • Loading branch information
catherinebirney committed Nov 26, 2024
1 parent 690f6a5 commit a319f3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flowsa/data_source_scripts/Census_ACS.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ def DP_5yr_parse(*, df_list, config, year, **_):
# concat dataframes
df = pd.concat(df_list2, sort=False)

# modify units
df["Unit"] = (df['Unit']
.str.split(' ').str[0]
.replace("#", "p")
.replace("%", "Percent")
)

# hard code data for flowsa format
df = assign_fips_location_system(df, year)
df['FlowType'] = 'TECHNOSPHERE_FLOW'
df['Class'] ='Other'
df.loc[df.Unit=='USD', 'Class'] = 'Money'
df['Year'] = year
df['ActivityProducedBy'] = 'Households'
df['SourceName'] = 'Census_ACS'
Expand Down

0 comments on commit a319f3b

Please sign in to comment.