datamade / census

A Python wrapper for the US Census API.
BSD 3-Clause "New" or "Revised" License
633 stars 137 forks source link

ACS5 income missing many values in 2015 #114

Open ppolonik2 opened 2 years ago

ppolonik2 commented 2 years ago

Hello,

When I try to download median income ('B06011_001E') for 2015 there are tons of missing values. Here is an example using California ('06') tracts, but this happens in other states too.

from census import Census
c = Census("<KEY>",year=2015)
outst = c.acs5.get(('B01003_001E','B06011_001E'),{'for':'tract:*','in':'state:06 county:*'})
inc = pd.DataFrame([o['B06011_001E'] for o in outst])
np.sum(np.isnan(inc))

This returns 2611 NaNs for me, out of 8057 tracts. The same is not true for total population (the other variable here). And the same is not true when changing the year to any other year in 2010-2019.

I'd appreciate any insight! Thanks!

ppolonik2 commented 2 years ago

Still hoping someone will look into this. I like this package but randomly missing data seems like a big problem.

nvenkat94 commented 1 year ago

It give correct data. this is api endpoint for 2015 https://api.census.gov/data/2015/acs/acs5?for=tract:*&in=state:06&get=NAME,GEO_ID,B06011_001E. I think you had checked otherthan 2015. 2021 has more data than 2015.