IN-CORE / pyincore-data

Mozilla Public License 2.0
0 stars 1 forks source link

made census util to provide dataset output #52

Closed ywkim312 closed 1 year ago

ywkim312 commented 2 years ago

I simply added to one more returning object that is dataset. I am not very sure if this is the right way to do it. If you have any suggestion of making the method better, please let me know, I will update.

you can test it by

    state_counties = ['01001', '01003']
    disloc_df, bgmap, dataset = CensusUtil.get_blockgroupdata_for_dislocation(state_counties, out_dataset=True)

and

    acs5_year = "2020"
    acs5_data_source = 'acs/acs5'
    acs5_columns = 'GEO_ID,NAME,B25002_001E,B25002_001M,B25004_006E,B25004_006M'
    state = '42'
    county = '017,029,045,091,101'
    geo_type = 'tract:*'

    api_json, api_df, dataset = CensusUtil.get_census_data(state, county, acs5_year, acs5_data_source, acs5_columns, geo_type)