Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/create_block_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def block_groups_10(state, county):
acs_df = pd.DataFrame(c.acs5.get(
ACS_VARS,
{'for': 'block group:*', 'in': 'county:{} state:{}'.format(county, state)},
year=2015
year=2016
))

census_df.rename(columns=CENSUS_10_VAR_MAP, inplace=True)
Expand Down
8 changes: 4 additions & 4 deletions scripts/create_data_demographics.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def get_10_data(geo_str):
ACS_12_VARS, {'for': 'state:*'}, year=2012
))
acs_df = pd.DataFrame(c.acs5.get(
ACS_VARS, {'for': 'state:*'}, year=2015
ACS_VARS, {'for': 'state:*'}, year=2016
))
elif geo_str == 'counties':
census_df = pd.DataFrame(c.sf1.get(
Expand All @@ -264,7 +264,7 @@ def get_10_data(geo_str):
ACS_12_VARS, {'for': 'county:*', 'in': 'state:*'}, year=2012
))
acs_df = pd.DataFrame(c.acs5.get(
ACS_VARS, {'for': 'county:*', 'in': 'state:*'}, year=2015
ACS_VARS, {'for': 'county:*', 'in': 'state:*'}, year=2016
))
elif geo_str == 'cities':
census_df = pd.DataFrame(c.sf1.get(
Expand All @@ -274,14 +274,14 @@ def get_10_data(geo_str):
ACS_12_VARS, {'for': 'place:*', 'in': 'state:*'}, year=2012
))
acs_df = pd.DataFrame(c.acs5.get(
ACS_VARS, {'for': 'place:*', 'in': 'state:*'}, year=2015
ACS_VARS, {'for': 'place:*', 'in': 'state:*'}, year=2016
))
# Handle ACS var difference
acs_df['NAME'] = acs_df['NAME'].apply(lambda x: ','.join(x.split(',')[:-1]).strip())
else:
census_df = state_county_sub_data(c.sf1, geo_str, CENSUS_10_VARS, 2010)
acs_12_df = state_county_sub_data(c.acs5, geo_str, ACS_12_VARS, 2012)
acs_df = state_county_sub_data(c.acs5, geo_str, ACS_VARS, 2015)
acs_df = state_county_sub_data(c.acs5, geo_str, ACS_VARS, 2016)

census_df.rename(columns=CENSUS_10_VAR_MAP, inplace=True)
acs_12_df.rename(columns=ACS_12_VAR_MAP, inplace=True)
Expand Down