jtleider / censusdata

Download data from Census API
MIT License
139 stars 29 forks source link

Cannot find Variables that start with S #5

Closed Crudelis-rgb closed 5 years ago

Crudelis-rgb commented 5 years ago

Hello Pythoneers,

as stated in the Title, I am having troubles accessing variables that start with S. Using the American FactFinder download center (https://factfinder.census.gov/faces/nav/jsf/pages/download_center.xhtml) the "AGE AND SEX" datatable with its corresponding Number S0101 is available for download, however, the following code cannot find any tables: cd.printtable(cd.censustable("acs5",2017,"S0101")) Table not found! This behaviour occurred for all tables that start with S.

In particular, I am interested in the age distribution of certain census tracts which is provided in the above mentioned "AGE AND SEX" table. Using the search command of censusData, I was only able to find the "SEX BY AGE" table (B01001) which is not quite the same as I would have to add males and females together for all age groups.

Any help appreciated! Thank you,

Matthias

jtleider commented 5 years ago

Hi Matthias,

The way the subject tables are presented through the API appears to be a little different. The information in S0101 is presented in several different ways, which can be accessed in S0101_C01, S0101_C02, ..., S0101_C06.

In situations like this, I would recommend using the search function to identify candidate variables, as that can also help you identify table names. You indicate that you did try this, but note that the tabletype argument needs to be specified to search tables other than the detail tables. In this case, running censusdata.search('acs5', 2017, 'label', 'population', tabletype='subject') would work.

Best, Julien

jtleider commented 3 years ago

Hi Ethan, you can use the download function, you just need to specify tabletype='subject'. E.g.: censusdata.download('acs5', 2019, censusdata.censusgeo([('zip code tabulation area', '*')]), ['S0101_C01_001E', 'S0103_C02_001E', 'S0101_C01_030E'], tabletype='subject')

On Mon, Apr 19, 2021 at 10:33 AM Ethan A Broadfoot @.***> wrote:

Hi Julien, how do you download the subject tables using this package? I know from the api you use something like this...

https://api.census.gov/data/2019/acs/acs5/subject?get=NAME,S0101_C01_001E,S0103_C02_001E,S0101_C01_030E&for=zip%20code%20tabulation%20area :*

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jtleider/censusdata/issues/5#issuecomment-822563054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCA7F4KARZLZU44ZZ4ESE3TJRELFANCNFSM4IK3RFWA .

eabroadfoot commented 3 years ago

Thanks, I looked back at the docs after I sent you that and got it working. Thanks for the reply!

On Mon, Apr 19, 2021 at 18:41 Julien Leider @.***> wrote:

Hi Ethan, you can use the download function, you just need to specify tabletype='subject'. E.g.: censusdata.download('acs5', 2019, censusdata.censusgeo([('zip code tabulation area', '*')]), ['S0101_C01_001E', 'S0103_C02_001E', 'S0101_C01_030E'], tabletype='subject')

On Mon, Apr 19, 2021 at 10:33 AM Ethan A Broadfoot @.***> wrote:

Hi Julien, how do you download the subject tables using this package? I know from the api you use something like this...

https://api.census.gov/data/2019/acs/acs5/subject?get=NAME,S0101_C01_001E,S0103_C02_001E,S0101_C01_030E&for=zip%20code%20tabulation%20area :*

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/jtleider/censusdata/issues/5#issuecomment-822563054 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABCA7F4KARZLZU44ZZ4ESE3TJRELFANCNFSM4IK3RFWA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jtleider/censusdata/issues/5#issuecomment-822836054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOV7BG5KLP7LW2J7DB2NGE3TJSWSXANCNFSM4IK3RFWA .