mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-25 07:20:18 -07:00
Add Michigan EJ Screen into data-pipeline's ETL and provide automated scoring and statistics outputs (#1091)
* draft wip * initial commit * clear output from notebook * revert to65ceb7900f
* draft wip * initial commit * clear output from notebook * revert to65ceb7900f
* make michigan prefix for readable * standardize Michigan names and move all constants from class into field names module * standardize Michigan names and move all constants from class into field names module * include only pertinent columns for scoring comparison tool * michigan EJSCREEN standardization * final PR feedback * added exposition and summary of Michigan EJSCREEN * added exposition and summary of Michigan EJSCREEN * fix typo Co-authored-by: Saran Ahluwalia <ahlusar.ahluwalia@gmail.com>
This commit is contained in:
parent
24f8eb93c4
commit
a4137fdc98
6 changed files with 142 additions and 3 deletions
|
@ -295,6 +295,25 @@
|
|||
"energy_definition_alternative_draft_df"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "fe4a2939",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Load Michigan EJSCREEN\n",
|
||||
"michigan_ejscreen_data_path = (\n",
|
||||
" DATA_DIR / \"dataset\" / \"michigan_ejscreen\" / \"michigan_ejscreen.csv\"\n",
|
||||
")\n",
|
||||
"michigan_ejscreen_df = pd.read_csv(\n",
|
||||
" michigan_ejscreen_data_path,\n",
|
||||
" dtype={ExtractTransformLoad.GEOID_TRACT_FIELD_NAME: \"string\"},\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"michigan_ejscreen_df.head()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
@ -311,6 +330,7 @@
|
|||
" persistent_poverty_df,\n",
|
||||
" mapping_inequality_df,\n",
|
||||
" energy_definition_alternative_draft_df,\n",
|
||||
" michigan_ejscreen_df\n",
|
||||
"]\n",
|
||||
"\n",
|
||||
"merged_df = functools.reduce(\n",
|
||||
|
@ -456,6 +476,14 @@
|
|||
" priority_communities_field=field_names.ENERGY_RELATED_COMMUNITIES_DEFINITION_ALTERNATIVE,\n",
|
||||
" other_census_tract_fields_to_keep=[],\n",
|
||||
" ),\n",
|
||||
" Index(\n",
|
||||
" method_name=\"Michigan EJSCREEN\",\n",
|
||||
" priority_communities_field=field_names.MICHIGAN_EJSCREEN_PRIORITY_COMMUNITY_FIELD,\n",
|
||||
" other_census_tract_fields_to_keep=[\n",
|
||||
" field_names.MICHIGAN_EJSCREEN_SCORE_FIELD,\n",
|
||||
" field_names.MICHIGAN_EJSCREEN_PERCENTILE_FIELD,\n",
|
||||
" ],\n",
|
||||
" ), \n",
|
||||
" ]\n",
|
||||
" # Insert indices for each of the HOLC factors.\n",
|
||||
" # Note: since these involve no renaming, we write them using list comprehension.\n",
|
||||
|
@ -1298,7 +1326,7 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
@ -1312,7 +1340,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.6"
|
||||
"version": "3.6.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue