<jupyter_start><jupyter_text>Using census<jupyter_code>from census import Census
from us import states<jupyter_output><empty_output><jupyter_text>1. Initialize and test<jupyter_code>c = Census("ccbba958048dc88a5eb7f4c3293456b02f005ba9")

c.acs5.get(('NAME', 'B25034_010E'),
          {'for': 'state:{}'.format(states.MD.fips)})<jupyter_output><empty_output><jupyter_text>2. Get data of interest for epa region 01 states<jupyter_code># Example for one state
CT = c.acs5.get(('NAME', 'B19019_001E'),
          {'for': 'county subdivision:*', 'in': 'state:09'}, year = 2017)
CT[1]<jupyter_output><empty_output><jupyter_text>Using censusdata* seems easier for D03, etc. tables* see: https://api.census.gov/data/2015/acs/acs5/profile/groups/DP03.html<jupyter_code>import pandas as pd
import censusdata
censusdata.search('acs5', 2017, 'label', 'poverty', tabletype='profile')
poverty_allfam_pct = censusdata.download('acs5', 2017, 
                                         censusdata.censusgeo([('state', '09'), ('county subdivision', '*')]),
                                   ['DP03_0119PE',],
                                   tabletype='profile')
poverty_allfam_pct.describe()
poverty_allfam_pct.sort_values('DP03_0119PE', ascending=False).head(10)<jupyter_output><empty_output><jupyter_text>TODO: figure out how to loop data for these<jupyter_code># change to fips codes
state_ids = ["CT", "MA", "ME", "NH", "RI", "VT"]

state_ids

for i in range(len(state_ids)):
    print("State {}: {}".format(i + 1, state_ids[i]))<jupyter_output>State 1: CT
State 2: MA
State 3: ME
State 4: NH
State 5: RI
State 6: VT
{'fraction_non_alphanumeric': 0.15149625935162095, 'fraction_numerical': 0.05922693266832918, 'mean_word_length': 4.477815699658703, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '561145', 'license': 'MIT', 'n_tokens_mistral': 648, 'n_tokens_neox': 575, 'n_words': 117, 'path': 'code/python/data_epa01_cosub2017.ipynb', 'repo_name': 'jsecol/spatial', 'size': '1604'}