{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "https://api.census.gov/data/2010/dec/sf1/examples.html" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "#Imports\n", "import pandas as pd\n", "import os,requests" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "#Get key\n", "pdKey = pd.read_csv('{}/APIkeys.csv'.format(os.environ['localappdata']))\n", "census = pdKey.iloc[0,1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "List of variables:\n", "P003001: \n", "P003003: Total!!Black or African American alone" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#Census API\n", "theURL = 'https://api.census.gov/data/2010/dec/sf1'\n", "params = {'get':'P003001,P003003,P010001,P010004',\n", " 'for':'block:*',\n", " 'in':'state:37%county:063',\n", " 'key':census\n", " }\n", "r = requests.get(theURL,params)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
P003001P003003P010001P010004statecountytractblockGEOID10
097627347370630001011000370630001011000
135163114370630001011020370630001011020
251233515370630001011001370630001011001
359194014370630001011005370630001011005
459224720370630001011015370630001011015
\n", "
" ], "text/plain": [ " P003001 P003003 P010001 P010004 state county tract block GEOID10\n", "0 97 62 73 47 37 063 000101 1000 370630001011000\n", "1 35 16 31 14 37 063 000101 1020 370630001011020\n", "2 51 23 35 15 37 063 000101 1001 370630001011001\n", "3 59 19 40 14 37 063 000101 1005 370630001011005\n", "4 59 22 47 20 37 063 000101 1015 370630001011015" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Convert response to a dataframe\n", "rJSON =r.json()\n", "dfB = pd.DataFrame(rJSON[1:],columns=rJSON[0])\n", "dfB['GEOID10'] = dfB.state+dfB.county+dfB.tract+dfB.block\n", "dfB.head()" ] }, { "cell_type": "code", "execution_count": 95, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
P003001P003003P010001P010004statecountytractblockGEOID10
3379701531370630020171012370630020171012
\n", "
" ], "text/plain": [ " P003001 P003003 P010001 P010004 state county tract block \\\n", "3379 70 1 53 1 37 063 002017 1012 \n", "\n", " GEOID10 \n", "3379 370630020171012 " ] }, "execution_count": 95, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfB[dfB.GEOID10 == '370630020171012']" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [], "source": [ "#Export to a table\n", "dfB.iloc[:,[0,1,-1]].to_csv('Durham.csv',index=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Explore variables:\n", "* Variables: https://api.census.gov/data/2010/dec/sf1/variables.html\n", "* Groups: https://api.census.gov/data/2010/dec/sf1/groups.html" ] }, { "cell_type": "code", "execution_count": 89, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
attributesconceptgrouplabellimitpredicateOnlypredicateTyperequiredvalues
forNaNCensus API Geography SpecificationN/ACensus API FIPS 'for' clause0Truefips-forNaNNaN
inNaNCensus API Geography SpecificationN/ACensus API FIPS 'in' clause0Truefips-inNaNNaN
ucgidNaNCensus API Geography SpecificationN/AUniform Census Geography Identifier clause0TrueucgidNaNNaN
PCT022021NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22Total!!Female!!Noninstitutionalized population...0NaNintNaNNaN
P028E001NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal0NaNintNaNNaN
P028E002NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households0NaNintNaNNaN
P028E005NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!4-person household0NaNintNaNNaN
P028E006NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!5-person household0NaNintNaNNaN
P028E003NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!2-person household0NaNintNaNNaN
P028E004NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!3-person household0NaNintNaNNaN
P028E009NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Nonfamily households0NaNintNaNNaN
P028E007NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!6-person household0NaNintNaNNaN
P028E008NaNHOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI...P28ETotal!!Family households!!7-or-more-person hou...0NaNintNaNNaN
PCT022B001NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal0NaNintNaNNaN
PCT022B002NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal!!Male0NaNintNaNNaN
GEOCOMPNaNNaNN/AGeographic Component code0NaNstringdefault displayed{'item': {'R1': 'Not in an offshore area', 'S0...
PCT024023NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In group quarters!!Noninstitutionalized...0NaNintNaNNaN
PCT022B012NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal!!Female0NaNintNaNNaN
PCT022B013NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal!!Female!!Institutionalized population (1...0NaNintNaNNaN
PCT022B010NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal!!Male!!Noninstitutionalized population (...0NaNintNaNNaN
PCT022B011NaNGROUP QUARTERS POPULATION BY SEX BY GROUP QUA...PCT22BTotal!!Male!!Noninstitutionalized population (...0NaNintNaNNaN
PCT024019NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024018NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024017NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024016NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024015NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024014NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households!...0NaNintNaNNaN
PCT024013NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In nonfamily households0NaNintNaNNaN
PCT024012NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In households!!In family households!!No...0NaNintNaNNaN
PCT024021NaNHOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT...PCT24Total!!In group quarters0NaNintNaNNaN
..............................
PCT012I209NaNSEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO)PCT12ITotal!!Female!!110 years and over0NaNintNaNNaN
P012I010NaNSEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO)P12ITotal!!Male!!22 to 24 years0NaNintNaNNaN
PCT012G052NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!49 years0NaNintNaNNaN
PCT012G053NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!50 years0NaNintNaNNaN
PCT012G050NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!47 years0NaNintNaNNaN
HCT001020NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
HCT001021NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012G051NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!48 years0NaNintNaNNaN
P012I019NaNSEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO)P12ITotal!!Male!!62 to 64 years0NaNintNaNNaN
HCT001022NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012H100NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!97 years0NaNintNaNNaN
PCT012G056NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!53 years0NaNintNaNNaN
PCT012G057NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!54 years0NaNintNaNNaN
HCT001023NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012G054NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!51 years0NaNintNaNNaN
HCT001024NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012H102NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!99 years0NaNintNaNNaN
HCT001025NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012G055NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!52 years0NaNintNaNNaN
PCT012H101NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!98 years0NaNintNaNNaN
HCT001026NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012H104NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!105 to 109 years0NaNintNaNNaN
PCT012H103NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!100 to 104 years0NaNintNaNNaN
HCT001027NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
PCT012H106NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Female0NaNintNaNNaN
PCT012G058NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!55 years0NaNintNaNNaN
HCT001028NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Hispanic or Latino hou...0NaNintNaNNaN
PCT012G059NaNSEX BY AGE (TWO OR MORE RACES)PCT12GTotal!!Male!!56 years0NaNintNaNNaN
PCT012H105NaNSEX BY AGE (HISPANIC OR LATINO)PCT12HTotal!!Male!!110 years and over0NaNintNaNNaN
HCT001029NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Hispanic or Latino hou...0NaNintNaNNaN
\n", "

9000 rows × 9 columns

\n", "
" ], "text/plain": [ " attributes concept \\\n", "for NaN Census API Geography Specification \n", "in NaN Census API Geography Specification \n", "ucgid NaN Census API Geography Specification \n", "PCT022021 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "P028E001 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E002 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E005 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E006 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E003 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E004 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E009 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E007 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "P028E008 NaN HOUSEHOLD TYPE BY HOUSEHOLD SIZE (NATIVE HAWAI... \n", "PCT022B001 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "PCT022B002 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "GEOCOMP NaN NaN \n", "PCT024023 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT022B012 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "PCT022B013 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "PCT022B010 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "PCT022B011 NaN GROUP QUARTERS POPULATION BY SEX BY GROUP QUA... \n", "PCT024019 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024018 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024017 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024016 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024015 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024014 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024013 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024012 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "PCT024021 NaN HOUSEHOLD TYPE BY RELATIONSHIP FOR THE POPULAT... \n", "... ... ... \n", "PCT012I209 NaN SEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO) \n", "P012I010 NaN SEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO) \n", "PCT012G052 NaN SEX BY AGE (TWO OR MORE RACES) \n", "PCT012G053 NaN SEX BY AGE (TWO OR MORE RACES) \n", "PCT012G050 NaN SEX BY AGE (TWO OR MORE RACES) \n", "HCT001020 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "HCT001021 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012G051 NaN SEX BY AGE (TWO OR MORE RACES) \n", "P012I019 NaN SEX BY AGE (WHITE ALONE, NOT HISPANIC OR LATINO) \n", "HCT001022 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012H100 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "PCT012G056 NaN SEX BY AGE (TWO OR MORE RACES) \n", "PCT012G057 NaN SEX BY AGE (TWO OR MORE RACES) \n", "HCT001023 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012G054 NaN SEX BY AGE (TWO OR MORE RACES) \n", "HCT001024 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012H102 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "HCT001025 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012G055 NaN SEX BY AGE (TWO OR MORE RACES) \n", "PCT012H101 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "HCT001026 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012H104 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "PCT012H103 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "HCT001027 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012H106 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "PCT012G058 NaN SEX BY AGE (TWO OR MORE RACES) \n", "HCT001028 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "PCT012G059 NaN SEX BY AGE (TWO OR MORE RACES) \n", "PCT012H105 NaN SEX BY AGE (HISPANIC OR LATINO) \n", "HCT001029 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... \n", "\n", " group label limit \\\n", "for N/A Census API FIPS 'for' clause 0 \n", "in N/A Census API FIPS 'in' clause 0 \n", "ucgid N/A Uniform Census Geography Identifier clause 0 \n", "PCT022021 PCT22 Total!!Female!!Noninstitutionalized population... 0 \n", "P028E001 P28E Total 0 \n", "P028E002 P28E Total!!Family households 0 \n", "P028E005 P28E Total!!Family households!!4-person household 0 \n", "P028E006 P28E Total!!Family households!!5-person household 0 \n", "P028E003 P28E Total!!Family households!!2-person household 0 \n", "P028E004 P28E Total!!Family households!!3-person household 0 \n", "P028E009 P28E Total!!Nonfamily households 0 \n", "P028E007 P28E Total!!Family households!!6-person household 0 \n", "P028E008 P28E Total!!Family households!!7-or-more-person hou... 0 \n", "PCT022B001 PCT22B Total 0 \n", "PCT022B002 PCT22B Total!!Male 0 \n", "GEOCOMP N/A Geographic Component code 0 \n", "PCT024023 PCT24 Total!!In group quarters!!Noninstitutionalized... 0 \n", "PCT022B012 PCT22B Total!!Female 0 \n", "PCT022B013 PCT22B Total!!Female!!Institutionalized population (1... 0 \n", "PCT022B010 PCT22B Total!!Male!!Noninstitutionalized population (... 0 \n", "PCT022B011 PCT22B Total!!Male!!Noninstitutionalized population (... 0 \n", "PCT024019 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024018 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024017 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024016 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024015 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024014 PCT24 Total!!In households!!In nonfamily households!... 0 \n", "PCT024013 PCT24 Total!!In households!!In nonfamily households 0 \n", "PCT024012 PCT24 Total!!In households!!In family households!!No... 0 \n", "PCT024021 PCT24 Total!!In group quarters 0 \n", "... ... ... ... \n", "PCT012I209 PCT12I Total!!Female!!110 years and over 0 \n", "P012I010 P12I Total!!Male!!22 to 24 years 0 \n", "PCT012G052 PCT12G Total!!Male!!49 years 0 \n", "PCT012G053 PCT12G Total!!Male!!50 years 0 \n", "PCT012G050 PCT12G Total!!Male!!47 years 0 \n", "HCT001020 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "HCT001021 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012G051 PCT12G Total!!Male!!48 years 0 \n", "P012I019 P12I Total!!Male!!62 to 64 years 0 \n", "HCT001022 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012H100 PCT12H Total!!Male!!97 years 0 \n", "PCT012G056 PCT12G Total!!Male!!53 years 0 \n", "PCT012G057 PCT12G Total!!Male!!54 years 0 \n", "HCT001023 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012G054 PCT12G Total!!Male!!51 years 0 \n", "HCT001024 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012H102 PCT12H Total!!Male!!99 years 0 \n", "HCT001025 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012G055 PCT12G Total!!Male!!52 years 0 \n", "PCT012H101 PCT12H Total!!Male!!98 years 0 \n", "HCT001026 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012H104 PCT12H Total!!Male!!105 to 109 years 0 \n", "PCT012H103 PCT12H Total!!Male!!100 to 104 years 0 \n", "HCT001027 HCT1 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "PCT012H106 PCT12H Total!!Female 0 \n", "PCT012G058 PCT12G Total!!Male!!55 years 0 \n", "HCT001028 HCT1 Total!!Renter occupied!!Hispanic or Latino hou... 0 \n", "PCT012G059 PCT12G Total!!Male!!56 years 0 \n", "PCT012H105 PCT12H Total!!Male!!110 years and over 0 \n", "HCT001029 HCT1 Total!!Renter occupied!!Hispanic or Latino hou... 0 \n", "\n", " predicateOnly predicateType required \\\n", "for True fips-for NaN \n", "in True fips-in NaN \n", "ucgid True ucgid NaN \n", "PCT022021 NaN int NaN \n", "P028E001 NaN int NaN \n", "P028E002 NaN int NaN \n", "P028E005 NaN int NaN \n", "P028E006 NaN int NaN \n", "P028E003 NaN int NaN \n", "P028E004 NaN int NaN \n", "P028E009 NaN int NaN \n", "P028E007 NaN int NaN \n", "P028E008 NaN int NaN \n", "PCT022B001 NaN int NaN \n", "PCT022B002 NaN int NaN \n", "GEOCOMP NaN string default displayed \n", "PCT024023 NaN int NaN \n", "PCT022B012 NaN int NaN \n", "PCT022B013 NaN int NaN \n", "PCT022B010 NaN int NaN \n", "PCT022B011 NaN int NaN \n", "PCT024019 NaN int NaN \n", "PCT024018 NaN int NaN \n", "PCT024017 NaN int NaN \n", "PCT024016 NaN int NaN \n", "PCT024015 NaN int NaN \n", "PCT024014 NaN int NaN \n", "PCT024013 NaN int NaN \n", "PCT024012 NaN int NaN \n", "PCT024021 NaN int NaN \n", "... ... ... ... \n", "PCT012I209 NaN int NaN \n", "P012I010 NaN int NaN \n", "PCT012G052 NaN int NaN \n", "PCT012G053 NaN int NaN \n", "PCT012G050 NaN int NaN \n", "HCT001020 NaN int NaN \n", "HCT001021 NaN int NaN \n", "PCT012G051 NaN int NaN \n", "P012I019 NaN int NaN \n", "HCT001022 NaN int NaN \n", "PCT012H100 NaN int NaN \n", "PCT012G056 NaN int NaN \n", "PCT012G057 NaN int NaN \n", "HCT001023 NaN int NaN \n", "PCT012G054 NaN int NaN \n", "HCT001024 NaN int NaN \n", "PCT012H102 NaN int NaN \n", "HCT001025 NaN int NaN \n", "PCT012G055 NaN int NaN \n", "PCT012H101 NaN int NaN \n", "HCT001026 NaN int NaN \n", "PCT012H104 NaN int NaN \n", "PCT012H103 NaN int NaN \n", "HCT001027 NaN int NaN \n", "PCT012H106 NaN int NaN \n", "PCT012G058 NaN int NaN \n", "HCT001028 NaN int NaN \n", "PCT012G059 NaN int NaN \n", "PCT012H105 NaN int NaN \n", "HCT001029 NaN int NaN \n", "\n", " values \n", "for NaN \n", "in NaN \n", "ucgid NaN \n", "PCT022021 NaN \n", "P028E001 NaN \n", "P028E002 NaN \n", "P028E005 NaN \n", "P028E006 NaN \n", "P028E003 NaN \n", "P028E004 NaN \n", "P028E009 NaN \n", "P028E007 NaN \n", "P028E008 NaN \n", "PCT022B001 NaN \n", "PCT022B002 NaN \n", "GEOCOMP {'item': {'R1': 'Not in an offshore area', 'S0... \n", "PCT024023 NaN \n", "PCT022B012 NaN \n", "PCT022B013 NaN \n", "PCT022B010 NaN \n", "PCT022B011 NaN \n", "PCT024019 NaN \n", "PCT024018 NaN \n", "PCT024017 NaN \n", "PCT024016 NaN \n", "PCT024015 NaN \n", "PCT024014 NaN \n", "PCT024013 NaN \n", "PCT024012 NaN \n", "PCT024021 NaN \n", "... ... \n", "PCT012I209 NaN \n", "P012I010 NaN \n", "PCT012G052 NaN \n", "PCT012G053 NaN \n", "PCT012G050 NaN \n", "HCT001020 NaN \n", "HCT001021 NaN \n", "PCT012G051 NaN \n", "P012I019 NaN \n", "HCT001022 NaN \n", "PCT012H100 NaN \n", "PCT012G056 NaN \n", "PCT012G057 NaN \n", "HCT001023 NaN \n", "PCT012G054 NaN \n", "HCT001024 NaN \n", "PCT012H102 NaN \n", "HCT001025 NaN \n", "PCT012G055 NaN \n", "PCT012H101 NaN \n", "HCT001026 NaN \n", "PCT012H104 NaN \n", "PCT012H103 NaN \n", "HCT001027 NaN \n", "PCT012H106 NaN \n", "PCT012G058 NaN \n", "HCT001028 NaN \n", "PCT012G059 NaN \n", "PCT012H105 NaN \n", "HCT001029 NaN \n", "\n", "[9000 rows x 9 columns]" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Get list of variables and convert to a dataframe (transposed)\n", "varsJson =requests.get('https://api.census.gov/data/2010/dec/sf1/variables.json').json()\n", "dfVars = pd.DataFrame(varsJson['variables']).T\n", "dfVars" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
attributesconceptgrouplabellimitpredicateOnlypredicateTyperequiredvalues
forNaNCensus API Geography SpecificationN/ACensus API FIPS 'for' clause0Truefips-forNaNNaN
inNaNCensus API Geography SpecificationN/ACensus API FIPS 'in' clause0Truefips-inNaNNaN
ucgidNaNCensus API Geography SpecificationN/AUniform Census Geography Identifier clause0TrueucgidNaNNaN
P029009NaNHOUSEHOLD TYPE BY RELATIONSHIPP29Total!!In households!!In family households!!Ad...0NaNintNaNNaN
P029007NaNHOUSEHOLD TYPE BY RELATIONSHIPP29Total!!In households!!In family households!!Sp...0NaNintNaNNaN
P029008NaNHOUSEHOLD TYPE BY RELATIONSHIPP29Total!!In households!!In family households!!Bi...0NaNintNaNNaN
PCO008033NaNGROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT...PCO8Total (501)!!Female!!55 to 59 years0NaNintNaNNaN
PCO008034NaNGROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT...PCO8Total (501)!!Female!!60 to 64 years0NaNintNaNNaN
PCO008035NaNGROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT...PCO8Total (501)!!Female!!65 to 69 years0NaNintNaNNaN
PCO008036NaNGROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT...PCO8Total (501)!!Female!!70 to 74 years0NaNintNaNNaN
\n", "
" ], "text/plain": [ " attributes concept group \\\n", "for NaN Census API Geography Specification N/A \n", "in NaN Census API Geography Specification N/A \n", "ucgid NaN Census API Geography Specification N/A \n", "P029009 NaN HOUSEHOLD TYPE BY RELATIONSHIP P29 \n", "P029007 NaN HOUSEHOLD TYPE BY RELATIONSHIP P29 \n", "P029008 NaN HOUSEHOLD TYPE BY RELATIONSHIP P29 \n", "PCO008033 NaN GROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT... PCO8 \n", "PCO008034 NaN GROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT... PCO8 \n", "PCO008035 NaN GROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT... PCO8 \n", "PCO008036 NaN GROUP QUARTERS POPULATION IN COLLEGE/UNIVERSIT... PCO8 \n", "\n", " label limit \\\n", "for Census API FIPS 'for' clause 0 \n", "in Census API FIPS 'in' clause 0 \n", "ucgid Uniform Census Geography Identifier clause 0 \n", "P029009 Total!!In households!!In family households!!Ad... 0 \n", "P029007 Total!!In households!!In family households!!Sp... 0 \n", "P029008 Total!!In households!!In family households!!Bi... 0 \n", "PCO008033 Total (501)!!Female!!55 to 59 years 0 \n", "PCO008034 Total (501)!!Female!!60 to 64 years 0 \n", "PCO008035 Total (501)!!Female!!65 to 69 years 0 \n", "PCO008036 Total (501)!!Female!!70 to 74 years 0 \n", "\n", " predicateOnly predicateType required values \n", "for True fips-for NaN NaN \n", "in True fips-in NaN NaN \n", "ucgid True ucgid NaN NaN \n", "P029009 NaN int NaN NaN \n", "P029007 NaN int NaN NaN \n", "P029008 NaN int NaN NaN \n", "PCO008033 NaN int NaN NaN \n", "PCO008034 NaN int NaN NaN \n", "PCO008035 NaN int NaN NaN \n", "PCO008036 NaN int NaN NaN " ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.DataFrame(varsJson['variables']).T\n", "df.head(10)" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "attributes NaN\n", "concept RACE FOR THE POPULATION 18 YEARS AND OVER\n", "group P10\n", "label Total\n", "limit 0\n", "predicateOnly NaN\n", "predicateType int\n", "required NaN\n", "values NaN\n", "Name: P010001, dtype: object" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.loc['P010001']#:'P005012']" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
attributesconceptgrouplabellimitpredicateOnlypredicateTyperequiredvalues
P010014NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010015NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010016NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010017NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010010NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two races0NaNintNaNNaN
P010011NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010012NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010013NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010018NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010019NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010003NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!White alone0NaNintNaNNaN
P010004NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!Black or Africa...0NaNintNaNNaN
P010005NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!American Indian...0NaNintNaNNaN
P010006NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!Asian alone0NaNintNaNNaN
P010001NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total0NaNintNaNNaN
P010002NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race0NaNintNaNNaN
P010007NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!Native Hawaiian...0NaNintNaNNaN
P010008NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Population of one race!!Some Other Race...0NaNintNaNNaN
P010009NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races0NaNintNaNNaN
P010070NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of six races0NaNintNaNNaN
P010071NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of six ra...0NaNintNaNNaN
P010061NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010062NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010063NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P010064NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P010060NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010069NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P010065NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P010066NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P010067NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
..............................
P010020NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010025NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010026NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010027NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010028NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010021NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010022NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010023NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010024NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P010029NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010050NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010051NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010052NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010053NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010058NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010059NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010054NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010055NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010056NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010057NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010040NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010041NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010042NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010047NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010048NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010049NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P010043NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010044NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010045NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P010046NaNRACE FOR THE POPULATION 18 YEARS AND OVERP10Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
\n", "

71 rows × 9 columns

\n", "
" ], "text/plain": [ " attributes concept group \\\n", "P010014 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010015 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010016 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010017 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010010 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010011 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010012 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010013 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010018 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010019 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010003 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010004 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010005 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010006 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010001 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010002 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010007 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010008 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010009 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010070 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010071 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010061 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010062 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010063 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010064 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010060 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010069 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010065 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010066 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010067 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "... ... ... ... \n", "P010020 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010025 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010026 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010027 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010028 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010021 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010022 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010023 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010024 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010029 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010050 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010051 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010052 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010053 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010058 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010059 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010054 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010055 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010056 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010057 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010040 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010041 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010042 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010047 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010048 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010049 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010043 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010044 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010045 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "P010046 NaN RACE FOR THE POPULATION 18 YEARS AND OVER P10 \n", "\n", " label limit \\\n", "P010014 Total!!Two or More Races!!Population of two ra... 0 \n", "P010015 Total!!Two or More Races!!Population of two ra... 0 \n", "P010016 Total!!Two or More Races!!Population of two ra... 0 \n", "P010017 Total!!Two or More Races!!Population of two ra... 0 \n", "P010010 Total!!Two or More Races!!Population of two races 0 \n", "P010011 Total!!Two or More Races!!Population of two ra... 0 \n", "P010012 Total!!Two or More Races!!Population of two ra... 0 \n", "P010013 Total!!Two or More Races!!Population of two ra... 0 \n", "P010018 Total!!Two or More Races!!Population of two ra... 0 \n", "P010019 Total!!Two or More Races!!Population of two ra... 0 \n", "P010003 Total!!Population of one race!!White alone 0 \n", "P010004 Total!!Population of one race!!Black or Africa... 0 \n", "P010005 Total!!Population of one race!!American Indian... 0 \n", "P010006 Total!!Population of one race!!Asian alone 0 \n", "P010001 Total 0 \n", "P010002 Total!!Population of one race 0 \n", "P010007 Total!!Population of one race!!Native Hawaiian... 0 \n", "P010008 Total!!Population of one race!!Some Other Race... 0 \n", "P010009 Total!!Two or More Races 0 \n", "P010070 Total!!Two or More Races!!Population of six races 0 \n", "P010071 Total!!Two or More Races!!Population of six ra... 0 \n", "P010061 Total!!Two or More Races!!Population of four r... 0 \n", "P010062 Total!!Two or More Races!!Population of four r... 0 \n", "P010063 Total!!Two or More Races!!Population of five r... 0 \n", "P010064 Total!!Two or More Races!!Population of five r... 0 \n", "P010060 Total!!Two or More Races!!Population of four r... 0 \n", "P010069 Total!!Two or More Races!!Population of five r... 0 \n", "P010065 Total!!Two or More Races!!Population of five r... 0 \n", "P010066 Total!!Two or More Races!!Population of five r... 0 \n", "P010067 Total!!Two or More Races!!Population of five r... 0 \n", "... ... ... \n", "P010020 Total!!Two or More Races!!Population of two ra... 0 \n", "P010025 Total!!Two or More Races!!Population of two ra... 0 \n", "P010026 Total!!Two or More Races!!Population of three ... 0 \n", "P010027 Total!!Two or More Races!!Population of three ... 0 \n", "P010028 Total!!Two or More Races!!Population of three ... 0 \n", "P010021 Total!!Two or More Races!!Population of two ra... 0 \n", "P010022 Total!!Two or More Races!!Population of two ra... 0 \n", "P010023 Total!!Two or More Races!!Population of two ra... 0 \n", "P010024 Total!!Two or More Races!!Population of two ra... 0 \n", "P010029 Total!!Two or More Races!!Population of three ... 0 \n", "P010050 Total!!Two or More Races!!Population of four r... 0 \n", "P010051 Total!!Two or More Races!!Population of four r... 0 \n", "P010052 Total!!Two or More Races!!Population of four r... 0 \n", "P010053 Total!!Two or More Races!!Population of four r... 0 \n", "P010058 Total!!Two or More Races!!Population of four r... 0 \n", "P010059 Total!!Two or More Races!!Population of four r... 0 \n", "P010054 Total!!Two or More Races!!Population of four r... 0 \n", "P010055 Total!!Two or More Races!!Population of four r... 0 \n", "P010056 Total!!Two or More Races!!Population of four r... 0 \n", "P010057 Total!!Two or More Races!!Population of four r... 0 \n", "P010040 Total!!Two or More Races!!Population of three ... 0 \n", "P010041 Total!!Two or More Races!!Population of three ... 0 \n", "P010042 Total!!Two or More Races!!Population of three ... 0 \n", "P010047 Total!!Two or More Races!!Population of four r... 0 \n", "P010048 Total!!Two or More Races!!Population of four r... 0 \n", "P010049 Total!!Two or More Races!!Population of four r... 0 \n", "P010043 Total!!Two or More Races!!Population of three ... 0 \n", "P010044 Total!!Two or More Races!!Population of three ... 0 \n", "P010045 Total!!Two or More Races!!Population of three ... 0 \n", "P010046 Total!!Two or More Races!!Population of three ... 0 \n", "\n", " predicateOnly predicateType required values \n", "P010014 NaN int NaN NaN \n", "P010015 NaN int NaN NaN \n", "P010016 NaN int NaN NaN \n", "P010017 NaN int NaN NaN \n", "P010010 NaN int NaN NaN \n", "P010011 NaN int NaN NaN \n", "P010012 NaN int NaN NaN \n", "P010013 NaN int NaN NaN \n", "P010018 NaN int NaN NaN \n", "P010019 NaN int NaN NaN \n", "P010003 NaN int NaN NaN \n", "P010004 NaN int NaN NaN \n", "P010005 NaN int NaN NaN \n", "P010006 NaN int NaN NaN \n", "P010001 NaN int NaN NaN \n", "P010002 NaN int NaN NaN \n", "P010007 NaN int NaN NaN \n", "P010008 NaN int NaN NaN \n", "P010009 NaN int NaN NaN \n", "P010070 NaN int NaN NaN \n", "P010071 NaN int NaN NaN \n", "P010061 NaN int NaN NaN \n", "P010062 NaN int NaN NaN \n", "P010063 NaN int NaN NaN \n", "P010064 NaN int NaN NaN \n", "P010060 NaN int NaN NaN \n", "P010069 NaN int NaN NaN \n", "P010065 NaN int NaN NaN \n", "P010066 NaN int NaN NaN \n", "P010067 NaN int NaN NaN \n", "... ... ... ... ... \n", "P010020 NaN int NaN NaN \n", "P010025 NaN int NaN NaN \n", "P010026 NaN int NaN NaN \n", "P010027 NaN int NaN NaN \n", "P010028 NaN int NaN NaN \n", "P010021 NaN int NaN NaN \n", "P010022 NaN int NaN NaN \n", "P010023 NaN int NaN NaN \n", "P010024 NaN int NaN NaN \n", "P010029 NaN int NaN NaN \n", "P010050 NaN int NaN NaN \n", "P010051 NaN int NaN NaN \n", "P010052 NaN int NaN NaN \n", "P010053 NaN int NaN NaN \n", "P010058 NaN int NaN NaN \n", "P010059 NaN int NaN NaN \n", "P010054 NaN int NaN NaN \n", "P010055 NaN int NaN NaN \n", "P010056 NaN int NaN NaN \n", "P010057 NaN int NaN NaN \n", "P010040 NaN int NaN NaN \n", "P010041 NaN int NaN NaN \n", "P010042 NaN int NaN NaN \n", "P010047 NaN int NaN NaN \n", "P010048 NaN int NaN NaN \n", "P010049 NaN int NaN NaN \n", "P010043 NaN int NaN NaN \n", "P010044 NaN int NaN NaN \n", "P010045 NaN int NaN NaN \n", "P010046 NaN int NaN NaN \n", "\n", "[71 rows x 9 columns]" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df.group == 'P10']" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }