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

API returns value of -666666666 #72

Open
jeancochrane opened this issue Apr 4, 2019 · 7 comments · May be fixed by #75
Open

API returns value of -666666666 #72

jeancochrane opened this issue Apr 4, 2019 · 7 comments · May be fixed by #75

Comments

@jeancochrane
Copy link
Contributor

Some calls to acs5.state_county_tract() return the value -666666666. This seems like a semantically significant value, but I can't find documentation on what it means.

For a reproducible example, this call returns the value in question:

>>> c = Census(os.environ['CENSUS_API_KEY'], year=2016)
>>> c.acs5.state_county_tract('B19081_001E', 42, 101, '989100')

[{'B19081_001E': -666666666.0, 'state': '42', 'county': '101', 'tract': '989100'}]

Any thoughts on what this response means, and how I should handle it? So far I've just been converting them to nulls.

@loganpowell
Copy link

@jeancochrane
Copy link
Contributor Author

Exactly what I was looking for, thanks @loganpowell!

@fgregg fgregg reopened this Apr 8, 2019
@jeancochrane
Copy link
Contributor Author

How do you think the library should handle this response @fgregg? I'm happy to give a PR a shot if you can provide guidance.

@fgregg
Copy link
Member

fgregg commented Apr 8, 2019

I think it would be good to configure the library to do two things based on a user setting.

  1. cast these to null, and emit a warning
  2. raise an exception

Not sure what the default should be? Thoughts?

@jeancochrane
Copy link
Contributor Author

My reading of the docs is that this value means one of either:

  1. No data
  2. Not enough data to make an estimate
  3. Ratio of medians could not be calculated (?)

I don't feel confident I understand what's going on with 3), but 1) and 2) both indicate to me that casting to null and raising a warning would be a good default, since null is a common interpretation of "no data".

@fgregg
Copy link
Member

fgregg commented Apr 8, 2019

casting to null and raising a warning is probably a bit more backwards compatible too

@fgregg
Copy link
Member

fgregg commented Apr 8, 2019

not sure if the behaviour should be set on initialization of census class or on the get data methods

probably on the methods.

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

Successfully merging a pull request may close this issue.

3 participants