mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-27 21:11:17 -07:00
Adding persistent poverty tracts (#738)
* persistent poverty working * fixing left-padding * running black and adding persistent poverty to comp tool * fixing bug * running black and fixing linter * fixing linter * fixing linter error
This commit is contained in:
parent
d1ced6d584
commit
b1a4d26be8
15 changed files with 518 additions and 201 deletions
|
@ -39,7 +39,9 @@
|
|||
"source": [
|
||||
"# Following the tutorial at https://jtleider.github.io/censusdata/example1.html.\n",
|
||||
"# Full list of fields is at https://www2.census.gov/programs-surveys/acs/summary_file/2019/documentation/user_tools/ACS2019_Table_Shells.xlsx\n",
|
||||
"censusdata.printtable(censusdata.censustable(src=\"acs5\", year=ACS_YEAR, table=\"B19013\"))"
|
||||
"censusdata.printtable(\n",
|
||||
" censusdata.censustable(src=\"acs5\", year=ACS_YEAR, table=\"B19013\")\n",
|
||||
")"
|
||||
],
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
|
@ -65,8 +67,8 @@
|
|||
" year=ACS_YEAR,\n",
|
||||
" geo=censusdata.censusgeo(\n",
|
||||
" [\n",
|
||||
" (\"state\", fips) \n",
|
||||
" #, (\"county\", \"*\"), (\"block group\", \"*\")\n",
|
||||
" (\"state\", fips)\n",
|
||||
" # , (\"county\", \"*\"), (\"block group\", \"*\")\n",
|
||||
" ]\n",
|
||||
" ),\n",
|
||||
" var=[\"B23025_005E\", \"B23025_003E\", \"B19013_001E\"],\n",
|
||||
|
@ -75,7 +77,9 @@
|
|||
"\n",
|
||||
"df = pd.concat(dfs)\n",
|
||||
"\n",
|
||||
"df[GEOID_FIELD_NAME] = df.index.to_series().apply(func=fips_from_censusdata_censusgeo)\n",
|
||||
"df[GEOID_FIELD_NAME] = df.index.to_series().apply(\n",
|
||||
" func=fips_from_censusdata_censusgeo\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"df.head()"
|
||||
],
|
||||
|
@ -90,7 +94,13 @@
|
|||
"source": [
|
||||
"columns_to_include = [\"GEOID2\", \"Median household income (State)\"]\n",
|
||||
"\n",
|
||||
"df.rename(columns={\"GEOID10\": \"GEOID2\", \"B19013_001E\": \"Median household income (State)\"}, inplace=True)\n",
|
||||
"df.rename(\n",
|
||||
" columns={\n",
|
||||
" \"GEOID10\": \"GEOID2\",\n",
|
||||
" \"B19013_001E\": \"Median household income (State)\",\n",
|
||||
" },\n",
|
||||
" inplace=True,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# df[columns_to_include].to_csv(path_or_buf= \"/Users/lucas/Documents/usds/repos/justice40-tool/data/data-pipeline/data_pipeline/data/needs_to_be_moved_to_s3/2014_to_2019_state_median_income.csv\", index=False)"
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue