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

Issue on page /docs/d_access_census.html #66

Open
oliviasablan opened this issue May 28, 2024 · 9 comments
Open

Issue on page /docs/d_access_census.html #66

oliviasablan opened this issue May 28, 2024 · 9 comments

Comments

@oliviasablan
Copy link

I am having a problem using "c.acs5.state_county_tract()." I have not had issues using this previously, but just recently I cannot run it. I keep getting this error: "KeyError: 'long'". Is this an issue for other users?

@mmann1123
Copy link
Owner

Can you send a snippet of code so we can see how you are using it?

@oliviasablan
Copy link
Author

Yes of course. Here is the code:
FL_census = c.acs5.state_county_tract(fields = ('NAME', 'B03001_002E', 'B01003_001E', 'B07012_002E', 'C17002_002E', 'C17002_003E', 'B02001_002E'), state_fips = states.FL.fips, county_fips = "*", tract = "*", year = 2019)

I hav also included a screenshot of the error.
error

@mmann1123
Copy link
Owner

Hmm... I thought i knew what the problem is. But now I am not sure. Can you try running it with a limited number of fields eg 'NAME', 'B03001_002E',, and see if there is a problem with one of the field codes?

Are you able to make queries for other times/places fields? For instance try:

va_census = c.acs5.state_county_tract(fields = ('NAME', 'C17002_001E', 'C17002_002E', 'C17002_003E', 'B01003_001E'),
                                      state_fips = states.VA.fips,
                                      county_fips = "*",
                                      tract = "*",
                                      year = 2017)

Let me know.

@oliviasablan
Copy link
Author

I've tried both limiting the fields as well as trying a different state. I have also tried using a different year of data (2017 versus 2019), but the error is the same every time.

@mmann1123
Copy link
Owner

mmann1123 commented May 29, 2024 via email

@oliviasablan
Copy link
Author

I thought that may be the case as well, but no luck with a new API. Maybe it's a problem with my conda environment? I was thinking there may be a universal issue with this code, but if it just a problem on my end then I will try digging a little more. Thank you!

@mmann1123
Copy link
Owner

mmann1123 commented May 29, 2024 via email

@oliviasablan
Copy link
Author

Yes I am! I am not sure why this is happening all of the sudden since I have been using this same code with no changes for months now. I may have installed a new package in the same environment which caused problems with the census package.

@oliviasablan
Copy link
Author

Update: I just attempted to use my code again (with no changes) and it is now working... not sure what was going on with the census but it must have been resolved. Thank you for your help!

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