question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

get san diego & DC data from census with `variables.csv`

See original GitHub issue

Working notes

  1. most of the variables in in the sf3, not the sf1. So, this means the connections are to cenpy.base.Connection('2000sf3') and cenpy.base.Connection('DecennialSF31990'), not 2000sf1 or DecennialSF11990
  2. the ACS table column codes are not the SF3 column codes. So, B03001_004E doesn’t exist in the sf3. This means we must match by “category,” called concept in the census API.
  3. sf3 for 2000 from the API only goes down to block groups, not blocks.

currently, this means building up analogue columns by querying into the pandas dataframe, connection.variables:

import cenpy
c2000sf3 = cenpy.base.Connection('2000sf3')
has_ancestry = c2000sf3.variables['concept'].str.lower().apply(lambda x: 'ancestry' in x)
c2000sf3.variables[has_ancestry]['concept'] 

So, if we can get the column names that correspond, then:

c2000sf3.query(columns=columns, geo_unit='block group', 
               geo_filter=dict(state='06',county='073', tract='*'))

should work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
knaaptimecommented, Dec 12, 2018

the necessary data are now distributed through quilt

Read more comments on GitHub >

github_iconTop Results From Across the Web

American Community Survey 5-Year Data (2009-2021)
Data Profiles contain broad social, economic, housing, and demographic information. The data are presented as population counts and percentages.
Read more >
Available APIs - Census Bureau
Explore census data with visualizations and view tutorials. Our surveys provide periodic and comprehensive statistics about the nation. This  ...
Read more >
Understanding and Using American Community Survey Data
Variable. Data Set. Median household income. ACS 1-Year Estimates. Population below poverty level ... Case Study #1: San Diego Region: City Data Profile....
Read more >
Census Data API User Guide
The purpose of this user guide is to instruct developers and researchers on how to use the. Census Data Application Programming Interface ...
Read more >
2020 Population and Housing State Data - Census Bureau
The 2020 Census data underlying this visualization are available in the Redistricting Data Summary Files. We're currently preparing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found