{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "https://api.census.gov/data/2010/dec/sf1/examples.html\n", "\n", "Example of extracting census attribute data (Block population and block black population), e.g. mimicking AFF query and extraction. " ] }, { "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: Total\n", "P003003: 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:183',\n", " 'key':census\n", " }\n", "r = requests.get(theURL,params)" ] }, { "cell_type": "code", "execution_count": 9, "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
0230146185115371830501001097371830501001097
10000371830501001103371830501001103
2209209371830501001105371830501001105
322171813371830501001107371830501001107
421151610371830501001116371830501001116
\n", "
" ], "text/plain": [ " P003001 P003003 P010001 P010004 state county tract block GEOID10\n", "0 230 146 185 115 37 183 050100 1097 371830501001097\n", "1 0 0 0 0 37 183 050100 1103 371830501001103\n", "2 20 9 20 9 37 183 050100 1105 371830501001105\n", "3 22 17 18 13 37 183 050100 1107 371830501001107\n", "4 21 15 16 10 37 183 050100 1116 371830501001116" ] }, "execution_count": 9, "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": 11, "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
103291271371830501001020371830501001020
\n", "
" ], "text/plain": [ " P003001 P003003 P010001 P010004 state county tract block \\\n", "103 29 1 27 1 37 183 050100 1020 \n", "\n", " GEOID10 \n", "103 371830501001020 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfB[dfB.GEOID10 == '371830501001020']" ] }, { "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": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['attributes', 'concept', 'group', 'label', 'limit', 'predicateOnly',\n", " 'predicateType', 'required', 'values'],\n", " dtype='object')" ] }, "execution_count": 4, "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.columns" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": true }, "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
PCT001005NaNAMERICAN INDIAN AND ALASKA NATIVE ALONE WITH O...PCT1Total tribes tallied (300, A01-M38, M41-R98, S...0NaNintNaNNaN
H008003NaNTOTAL RACES TALLIED FOR HOUSEHOLDERSH8Total races tallied for householders!!Black or...0NaNintNaNNaN
P008069NaNRACEP8Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P008067NaNRACEP8Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P008066NaNRACEP8Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P008061NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008060NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008065NaNRACEP8Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P008064NaNRACEP8Total!!Two or More Races!!Population of five r...0NaNintNaNNaN
P008071NaNRACEP8Total!!Two or More Races!!Population of six ra...0NaNintNaNNaN
P008019NaNRACEP8Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P008011NaNRACEP8Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P008018NaNRACEP8Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P008017NaNRACEP8Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P008016NaNRACEP8Total!!Two or More Races!!Population of two ra...0NaNintNaNNaN
P008004NaNRACEP8Total!!Population of one race!!Black or Africa...0NaNintNaNNaN
P008050NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008053NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008051NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008052NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008058NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008059NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008040NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P008041NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P008042NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P008048NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008049NaNRACEP8Total!!Two or More Races!!Population of four r...0NaNintNaNNaN
P008030NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P008039NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
P008037NaNRACEP8Total!!Two or More Races!!Population of three ...0NaNintNaNNaN
..............................
P009019NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009039NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009031NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009030NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009032NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009040NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009044NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009043NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009042NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009041NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009053NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009052NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009055NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009054NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009051NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009050NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009069NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009068NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009067NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009066NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009063NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009062NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009061NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009060NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009071NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
P009073NaNHISPANIC OR LATINO, AND NOT HISPANIC OR LATINO...P9Total!!Not Hispanic or Latino!!Two or More Rac...0NaNintNaNNaN
HCT001013NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Owner occupied!!Hispanic or Latino hous...0NaNintNaNNaN
HCT001005NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Owner occupied!!Not Hispanic or Latino ...0NaNintNaNNaN
HCT001030NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Hispanic or Latino hou...0NaNintNaNNaN
HCT001022NaNTENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO...HCT1Total!!Renter occupied!!Not Hispanic or Latino...0NaNintNaNNaN
\n", "

153 rows × 9 columns

\n", "
" ], "text/plain": [ " attributes concept group \\\n", "PCT001005 NaN AMERICAN INDIAN AND ALASKA NATIVE ALONE WITH O... PCT1 \n", "H008003 NaN TOTAL RACES TALLIED FOR HOUSEHOLDERS H8 \n", "P008069 NaN RACE P8 \n", "P008067 NaN RACE P8 \n", "P008066 NaN RACE P8 \n", "P008061 NaN RACE P8 \n", "P008060 NaN RACE P8 \n", "P008065 NaN RACE P8 \n", "P008064 NaN RACE P8 \n", "P008071 NaN RACE P8 \n", "P008019 NaN RACE P8 \n", "P008011 NaN RACE P8 \n", "P008018 NaN RACE P8 \n", "P008017 NaN RACE P8 \n", "P008016 NaN RACE P8 \n", "P008004 NaN RACE P8 \n", "P008050 NaN RACE P8 \n", "P008053 NaN RACE P8 \n", "P008051 NaN RACE P8 \n", "P008052 NaN RACE P8 \n", "P008058 NaN RACE P8 \n", "P008059 NaN RACE P8 \n", "P008040 NaN RACE P8 \n", "P008041 NaN RACE P8 \n", "P008042 NaN RACE P8 \n", "P008048 NaN RACE P8 \n", "P008049 NaN RACE P8 \n", "P008030 NaN RACE P8 \n", "P008039 NaN RACE P8 \n", "P008037 NaN RACE P8 \n", "... ... ... ... \n", "P009019 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009039 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009031 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009030 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009032 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009040 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009044 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009043 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009042 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009041 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009053 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009052 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009055 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009054 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009051 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009050 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009069 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009068 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009067 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009066 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009063 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009062 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009061 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009060 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009071 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "P009073 NaN HISPANIC OR LATINO, AND NOT HISPANIC OR LATINO... P9 \n", "HCT001013 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... HCT1 \n", "HCT001005 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... HCT1 \n", "HCT001030 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... HCT1 \n", "HCT001022 NaN TENURE BY HISPANIC OR LATINO ORIGIN OF HOUSEHO... HCT1 \n", "\n", " label limit \\\n", "PCT001005 Total tribes tallied (300, A01-M38, M41-R98, S... 0 \n", "H008003 Total races tallied for householders!!Black or... 0 \n", "P008069 Total!!Two or More Races!!Population of five r... 0 \n", "P008067 Total!!Two or More Races!!Population of five r... 0 \n", "P008066 Total!!Two or More Races!!Population of five r... 0 \n", "P008061 Total!!Two or More Races!!Population of four r... 0 \n", "P008060 Total!!Two or More Races!!Population of four r... 0 \n", "P008065 Total!!Two or More Races!!Population of five r... 0 \n", "P008064 Total!!Two or More Races!!Population of five r... 0 \n", "P008071 Total!!Two or More Races!!Population of six ra... 0 \n", "P008019 Total!!Two or More Races!!Population of two ra... 0 \n", "P008011 Total!!Two or More Races!!Population of two ra... 0 \n", "P008018 Total!!Two or More Races!!Population of two ra... 0 \n", "P008017 Total!!Two or More Races!!Population of two ra... 0 \n", "P008016 Total!!Two or More Races!!Population of two ra... 0 \n", "P008004 Total!!Population of one race!!Black or Africa... 0 \n", "P008050 Total!!Two or More Races!!Population of four r... 0 \n", "P008053 Total!!Two or More Races!!Population of four r... 0 \n", "P008051 Total!!Two or More Races!!Population of four r... 0 \n", "P008052 Total!!Two or More Races!!Population of four r... 0 \n", "P008058 Total!!Two or More Races!!Population of four r... 0 \n", "P008059 Total!!Two or More Races!!Population of four r... 0 \n", "P008040 Total!!Two or More Races!!Population of three ... 0 \n", "P008041 Total!!Two or More Races!!Population of three ... 0 \n", "P008042 Total!!Two or More Races!!Population of three ... 0 \n", "P008048 Total!!Two or More Races!!Population of four r... 0 \n", "P008049 Total!!Two or More Races!!Population of four r... 0 \n", "P008030 Total!!Two or More Races!!Population of three ... 0 \n", "P008039 Total!!Two or More Races!!Population of three ... 0 \n", "P008037 Total!!Two or More Races!!Population of three ... 0 \n", "... ... ... \n", "P009019 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009039 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009031 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009030 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009032 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009040 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009044 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009043 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009042 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009041 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009053 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009052 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009055 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009054 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009051 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009050 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009069 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009068 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009067 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009066 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009063 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009062 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009061 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009060 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009071 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "P009073 Total!!Not Hispanic or Latino!!Two or More Rac... 0 \n", "HCT001013 Total!!Owner occupied!!Hispanic or Latino hous... 0 \n", "HCT001005 Total!!Owner occupied!!Not Hispanic or Latino ... 0 \n", "HCT001030 Total!!Renter occupied!!Hispanic or Latino hou... 0 \n", "HCT001022 Total!!Renter occupied!!Not Hispanic or Latino... 0 \n", "\n", " predicateOnly predicateType required values \n", "PCT001005 NaN int NaN NaN \n", "H008003 NaN int NaN NaN \n", "P008069 NaN int NaN NaN \n", "P008067 NaN int NaN NaN \n", "P008066 NaN int NaN NaN \n", "P008061 NaN int NaN NaN \n", "P008060 NaN int NaN NaN \n", "P008065 NaN int NaN NaN \n", "P008064 NaN int NaN NaN \n", "P008071 NaN int NaN NaN \n", "P008019 NaN int NaN NaN \n", "P008011 NaN int NaN NaN \n", "P008018 NaN int NaN NaN \n", "P008017 NaN int NaN NaN \n", "P008016 NaN int NaN NaN \n", "P008004 NaN int NaN NaN \n", "P008050 NaN int NaN NaN \n", "P008053 NaN int NaN NaN \n", "P008051 NaN int NaN NaN \n", "P008052 NaN int NaN NaN \n", "P008058 NaN int NaN NaN \n", "P008059 NaN int NaN NaN \n", "P008040 NaN int NaN NaN \n", "P008041 NaN int NaN NaN \n", "P008042 NaN int NaN NaN \n", "P008048 NaN int NaN NaN \n", "P008049 NaN int NaN NaN \n", "P008030 NaN int NaN NaN \n", "P008039 NaN int NaN NaN \n", "P008037 NaN int NaN NaN \n", "... ... ... ... ... \n", "P009019 NaN int NaN NaN \n", "P009039 NaN int NaN NaN \n", "P009031 NaN int NaN NaN \n", "P009030 NaN int NaN NaN \n", "P009032 NaN int NaN NaN \n", "P009040 NaN int NaN NaN \n", "P009044 NaN int NaN NaN \n", "P009043 NaN int NaN NaN \n", "P009042 NaN int NaN NaN \n", "P009041 NaN int NaN NaN \n", "P009053 NaN int NaN NaN \n", "P009052 NaN int NaN NaN \n", "P009055 NaN int NaN NaN \n", "P009054 NaN int NaN NaN \n", "P009051 NaN int NaN NaN \n", "P009050 NaN int NaN NaN \n", "P009069 NaN int NaN NaN \n", "P009068 NaN int NaN NaN \n", "P009067 NaN int NaN NaN \n", "P009066 NaN int NaN NaN \n", "P009063 NaN int NaN NaN \n", "P009062 NaN int NaN NaN \n", "P009061 NaN int NaN NaN \n", "P009060 NaN int NaN NaN \n", "P009071 NaN int NaN NaN \n", "P009073 NaN int NaN NaN \n", "HCT001013 NaN int NaN NaN \n", "HCT001005 NaN int NaN NaN \n", "HCT001030 NaN int NaN NaN \n", "HCT001022 NaN int NaN NaN \n", "\n", "[153 rows x 9 columns]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Reveal varibles containing the word \"Black\"\n", "dfVars[dfVars.label.str.contains('Black')]" ] }, { "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.8" } }, "nbformat": 4, "nbformat_minor": 2 }