Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'census.acs5.get' can't retrieve data on county subdivision level for a certain county. #73

Open
BowenLiu92 opened this issue Apr 5, 2019 · 1 comment

Comments

@BowenLiu92
Copy link

Dear datamade team,

I found out that c.acs5. state_county_subdivision can only retrieve 2016 data as the latest year so I'm trying to retrieve data using c.acs5.get as I can get 2017 this way. But I couldn't refine the county subdivision data results to just a specific county.

The code I used:

c.acs5.get(('NAME', 'B01001_001E', 'B01001_002E', 'B01001_003E', 'B01001_004E', 'B01001_005E', 
            'B01001_006E',   'B01001_026E', 'B01001A_001E', 'B01001B_001E'),
          {'for':'county subdivision:*', 'in':'county: 077', 'in':'state: 42'}, year = 2017)

But this will give me data for all county subdivisions in Pennsylvania while I only want the county subdivision data for Lehigh County, PA.

Is there anyway to achieve that? Thanks.

@jeancochrane
Copy link
Contributor

I think you want to combine your two in filters, i.e.:

{'for': 'county subdivision:*', 'in': 'county:077, state:42'}

Since the filters are read as a dict, I believe your second in filter (state:42) is overriding the first (county:077) so you're getting every county subdivision in PA instead of in Lehigh County.

Also, hello from Philadelphia County! I was just hiking in Lehigh County last weekend, it's beautiful up there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants