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_state does not work for years from 2010-2015 #71

Open
xzhou56 opened this issue Mar 5, 2019 · 6 comments
Open

census.acs5_state does not work for years from 2010-2015 #71

xzhou56 opened this issue Mar 5, 2019 · 6 comments

Comments

@xzhou56
Copy link

xzhou56 commented Mar 5, 2019

To whom it may concern:

I am trying to use census.acs5_state and census.acs5_state_place. They only worked well for the year 2009 and 2016, but not working for years from 2010 to 2015. Is there anything wrong with these years?

Thanks.

@semcogli
Copy link

semcogli commented Mar 5, 2019

Could you post your codes and error message?

@xzhou56
Copy link
Author

xzhou56 commented Mar 6, 2019

Sure.
c.acs5.state('B01001_004E', '*',year=2015)
if changing the year to 2009 or 2016, it works.

The same issue happened to state_place:
c.acs5.state_place(tuple(varlist),'','',year=2010)

Error message:
CensusException: <title>Error report</title><style></style>

HTTP Status 404 - /data/2010/acs5


type Status report

message /data/2010/acs5

description The requested resource is not available.


@semcogli
Copy link

semcogli commented Mar 6, 2019

it works for me. Requests for years from 10 to 15 returned data as normal. Not sure what happens there. one thing you can try is to reinstall your census library and see if that helps. Best regards.

c.acs5.state('B01001_004E', '*',year=2015)
[{'B01001_004E': 156380.0, 'state': '01'},
{'B01001_004E': 26276.0, 'state': '02'},
{'B01001_004E': 231249.0, 'state': '04'},
{'B01001_004E': 103613.0, 'state': '05'},
{'B01001_004E': 1295030.0, 'state': '06'},

@xzhou56
Copy link
Author

xzhou56 commented Mar 6, 2019

Thanks. I uninstalled and re-installed, but it still didn't work for me.

So I went back to census API document, we found that, the api call for 2009 data is a little different from all other years.
In 2009: api.census.gov/data/2009/acs5?
But in other years: https://api.census.gov/data/2011/acs/acs5?

I don't know if this affects your library but wanna share here just in case someone else has a similar issue like me.

@semcogli
Copy link

semcogli commented Mar 6, 2019

the issue you mentioned has been taken cared of, I believe,
https://github.com/datamade/census/blob/master/census/core.py
line 278, you can see the endpoint url switches depends on the years you are querying.
you can check your local file and see if it is correct.

@palewire
Copy link
Contributor

I upgraded to the latest version and this was fixed for me.

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

3 participants