diff --git a/ntd/2021_2022_crosswalk.ipynb b/ntd/2021_2022_crosswalk.ipynb
new file mode 100644
index 000000000..5190d7888
--- /dev/null
+++ b/ntd/2021_2022_crosswalk.ipynb
@@ -0,0 +1,33 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1954eed3-c549-4130-85e4-853c9a1b1fae",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "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.9.13"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/ntd/README.md b/ntd/README.md
index 873d76444..b1db7081c 100644
--- a/ntd/README.md
+++ b/ntd/README.md
@@ -7,4 +7,16 @@ This report shows general ridership trends by transit agency, mode, and type of
## Datasets
1. NTD monthly data: https://www.transit.dot.gov/ntd/data-product/monthly-module-adjusted-data-release.
2. [RTPA list](https://gis.data.ca.gov/datasets/CAEnergy::regional-transportation-planning-agencies/explore?appid=cf412a17daaa47bca93c6d6b7e77aff0&edit=true)
-3. Download our processed full data [here](https://console.cloud.google.com/storage/browser/calitp-publish-data-analysis).
\ No newline at end of file
+3. Download our processed full data [here](https://console.cloud.google.com/storage/browser/calitp-publish-data-analysis).
+
+
+# NTD ID Changes 2021_2022 Crosswalk
+
+NTD IDs have changed for some agencies from 2021 to 2022 i.e. NTD Id is no longer unique at the year level.
+
+For the NTDs ID that have changed we have mapped to the historical data.
+
+## Datasets
+1. NTD 2021_2022 raw data: (gs://calitp-analytics-data/data-analyses/ntd/ntd_2021_2022.csv)
+2. Data that required manual crosswalk: (gs://calitp-analytics-data/data-analyses/ntd/manual.csv)
+3. Download our final data that has crosswalk as well as additional rem
diff --git a/ntd/manual_crosswalk.csv b/ntd/manual_crosswalk.csv
new file mode 100644
index 000000000..9078ca3f8
--- /dev/null
+++ b/ntd/manual_crosswalk.csv
@@ -0,0 +1,53 @@
+ntd_id_2022 ,reported_by_name,legacy_ntd_id,agency_name,city,ntd_id_2021,Remarks
+231,,0T33,Confederated Tribes of Warm Springs,Warm Springs,,No 2021 data
+90306,,,Stanislaus Regional Transit Authority,Modesto,,the county doesn’t have data after 2021 so could be the same data
+44982,Georgia Department of Transportation,,Southern Georgia Regional Commission,Valdosta,,Lowndes county has no data after 2021 so could be the same data
+40199,,,Autonomous Municipality of Vega Alta,Vega Alta,,No 2021 data
+41182,Municipality of Comerio,1R05-003,Comerio,,,no 2021 data but has 2020 data under legacy id 4R09-41182
+10008,Massachusetts Department of Transportation ,,Pioneer Valley Transit Authority Intercity Bus,Springfield,,
+99394,,9T29,Elko Band Council,Elko,,No 2021 data
+20228,,,"Enterprise Holdings, LLC",Syracuse,,
+66345,,,Taos Pueblo,Taos,,
+90307,,,Town of Prescott Valley,Prescott Valley,,
+20227,,,Town of Wallkill,Middletown,,
+55665,Indiana Department of Transportation,,Brown County YMCA,Nashville,,
+80299,,,"Silver Key Senior Services, Inc",Colorado Springs,,
+90310,,,Tulare County Regional Transit Agency,Visalia,,
+30205,,,"Transit Management of Central Maryland, Inc.",Annapolis Junction,,
+80138,Colorado Department of Transportation,8R01-043,"Dynamic Dimensions, Inc.",Burlington,,
+40274,,,Town of Morrisville,Morrisville,,
+80179,Colorado Department of Transportation,8R01-029,City of Burlington,Burlington,,
+60276,,,Plaquemines Port Harbor Terminal District,Belle Chasse,,
+88239,Utah Department of Transportation,,High Valley Transit District,,,
+50525,,,Hamilton County,Noblesville,,
+80211,Colorado Department of Transportation,8R01-033,Town of Limon,Limon,,
+44983,Mississippi Department of Transportation,,Philadelphia Transit,Philadelphia,,
+88236,Utah Department of Transportation,,Washington County (on behalf of Council On Aging),St. George,,
+11246,,,Vermont Agency of Transportation,Barre,,
+31047,West Virginia Department of Transportation,,Raleigh County Commission on Aging,Beckley,,
+50526,,,"Hancock County, Indiana",Greenfield,,
+88268,Utah Department of Transportation,,Cache Employment & Training Center (CETC),Logan,,
+90309,,,City of Casa Grande,Casa Grande,,
+99460,Arizona Department of Transportation,,Verde Valley Caregivers Coalition,Sedona,,
+99461,Arizona Department of Transportation,,Town of Florence,Florence,,
+88242,Utah Department of Transportation,,Sevier County ,Richfield,,
+30998,West Virginia Department of Transportation,,Ritchie County Integrated Family Services,Harrisville,,
+88245,Utah Department of Transportation,,Piute County Senior Citizen Center,Junction,,
+88265,Utah Department of Transportation,,Common Ground Outdoor Adventures,Logan,,
+99465,Arizona Department of Transportation,,Easterseals Blake Foundation,Tucson,,
+55666,Ohio Department of Transportation,,Buckeye Community Services,Jackson,,
+31014,West Virginia Department of Transportation,,Friends of Hansford Center,Saint Albans,,
+99466,Arizona Department of Transportation,,Assist to Independence,Tuba City,,
+99464,Arizona Department of Transportation,,Helping Ourselves Pursue Enrichment Incorporated,Tucson,,
+55664,Indiana Department of Transportation,,Shelby Senior Services ,Shelbyville,,
+88233,Utah Department of Transportation,,Uintah Healthcare Special Service District,Vernal,,
+88304,Colorado Department of Transportation,,"Boulder, City of",Boulder,,
+31049,West Virginia Department of Transportation,,Hardy County Committee on Aging Inc,Moorefield,,
+31002,West Virginia Department of Transportation,,Neighbor Network/Pleasants County Senior Services,Saint Marys,,
+31050,West Virginia Department of Transportation,,Council of Senior Tyler Countians Inc,Middlebourne,,
+31046,West Virginia Department of Transportation,,"Commission On Aging Family Services Inc., The",Petersburg,,
+99463,Arizona Department of Transportation,,New Horizons Disability Empowerment Center,Prescott Valley,,
+88253,Utah Department of Transportation,,Kane County Senior Citizens Improvement Corp,Kanab,,
+99462,Arizona Department of Transportation,,Saguaro Foundation Community Living Programs,Yuma,,
+99467,Arizona Department of Transportation,,Town of springerville AZ,Springerville,,
+31048,West Virginia Department of Transportation,,"Greenbrier Co. Committee on Aging, Inc.",Rupert,,
diff --git a/ntd/ntd_id_changes.ipynb b/ntd/ntd_id_changes_crosswalk.ipynb
similarity index 51%
rename from ntd/ntd_id_changes.ipynb
rename to ntd/ntd_id_changes_crosswalk.ipynb
index 6afeb77f2..5a97bcc7d 100644
--- a/ntd/ntd_id_changes.ipynb
+++ b/ntd/ntd_id_changes_crosswalk.ipynb
@@ -24,11 +24,10 @@
"import numpy as np\n",
"import pandas as pd\n",
"\n",
- "#GCS_BUCKET = \"gs://calitp-ntd-data-products\"\n",
- "#GCS_PATH = (f\"{GCS_BUCKET}annual-database-agency-information/\"\n",
- "# \"dt=2023-11-15/ts=2023-11-15T22:29:51.925030+00:00/year=2022/\"\n",
- "# \"annual-database-agency-information.jsonl.gz\"\n",
- "# )\n",
+ "#GCS_BUCKET = \"gs://calitp-analytics-data/data-analyses/ntd\"\n",
+ "GCS_PATH = \"gs://calitp-analytics-data/data-analyses/ntd/\"\n",
+ "FILE_NAMEa = \"ntd_2021_2022.csv\"\n",
+ "FILE_NAMEb = \"manual.csv\"\n",
"\n",
"LOCAL_PATH = \"ntd_2021_2022.csv\""
]
@@ -38,9 +37,19 @@
"execution_count": 2,
"id": "85b4ef76-811d-499e-94c1-166c9cd4b0d5",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/opt/conda/lib/python3.9/site-packages/google/auth/_default.py:78: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a \"quota exceeded\" or \"API not enabled\" error. See the following page for troubleshooting: https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. \n",
+ " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n"
+ ]
+ }
+ ],
"source": [
- "df_full = pd.read_csv(LOCAL_PATH)\n",
+ "df_full = pd.read_csv(\n",
+ " f\"{GCS_PATH}{FILE_NAMEa}\")\n",
"\n",
"df_2021 = df_full[df_full.year==2021].reset_index(drop=True)\n",
"df_2022 = df_full[df_full.year==2022].reset_index(drop=True)"
@@ -994,22 +1003,10 @@
"m3._merge.value_counts()"
]
},
- {
- "cell_type": "markdown",
- "id": "ca15336a-42d3-4d8e-94c1-9142bd4f5394",
- "metadata": {},
- "source": [
- "### Parsing `ntd_id` into a no-prefix version can help \n",
- "\n",
- "If we are going to remove the prefix...we could do this earlier and hopefully get more to merge. Although, this does mean that we are left with variations on `agency_name` and `reported_by_name`, which still needs to make it into our crosswalk, even if we do not use it to merge.\n",
- "\n",
- "Left with a batch of about 60 to reconcile manually."
- ]
- },
{
"cell_type": "code",
"execution_count": 16,
- "id": "a3645517-1cbe-42b0-bd1a-3c080f64bd9f",
+ "id": "fa780a5a-81d0-4953-b7ef-b83312fedd75",
"metadata": {},
"outputs": [
{
@@ -1052,1020 +1049,1306 @@
" \n",
"
\n",
" \n",
- " 61 | \n",
- " 11238 | \n",
- " NaN | \n",
- " NaN | \n",
- " Bay State Cruise Company | \n",
- " NaN | \n",
- " 3e52a7c9c6b2b668f3f8d8aaf7407bb1 | \n",
- " 2021.0 | \n",
- " 11238 | \n",
- " 11238 | \n",
- " NaN | \n",
- " Bay State LLC | \n",
- " Boston | \n",
- " 0d5ba39814c8d079274b8a9f0cc57094 | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 56 | \n",
- " 3R03-30130 | \n",
- " 3R03-010 | \n",
- " Maryland Department of Transportation | \n",
- " Baltimore County Department of Aging | \n",
- " Baltimore | \n",
- " a78720414cc2f8110bc995522b13af5f | \n",
+ " 0 | \n",
+ " 5R02-50399 | \n",
+ " 5R02-004 | \n",
+ " Indiana Department of Transportation | \n",
+ " Fayette Community Commissioners | \n",
+ " Connersville | \n",
+ " eeae713c46c405e3c8d4f001df04ab08 | \n",
" 2021.0 | \n",
- " 30130 | \n",
- " 30130 | \n",
- " Maryland Department of Transportation | \n",
- " Baltimore County Department of Public Works Tr... | \n",
- " Towson | \n",
- " 82625c40cb5f233003bd99bf662c0f8c | \n",
+ " 50399 | \n",
+ " 50399 | \n",
+ " Indiana Department of Transportation | \n",
+ " Fayette County Council Agency on Aging and Aged | \n",
+ " Connersville | \n",
+ " 4e3cd53439c5b16a8db255353ab5f452 | \n",
" 2022.0 | \n",
" both | \n",
"
\n",
" \n",
- " 24 | \n",
- " 40105 | \n",
- " 4105 | \n",
+ " 1 | \n",
+ " 167 | \n",
+ " 0T19 | \n",
" NaN | \n",
- " Puerto Rico Highway and Transportation Authori... | \n",
- " San Juan | \n",
- " 15dfe7c9516dd80cfcbd7e44894c3cd0 | \n",
+ " Native Village of Crooked Creek | \n",
+ " Crooked Creek | \n",
+ " 5f174c276fcb5bdafe25d2d81bc90dc9 | \n",
" 2021.0 | \n",
- " 40105 | \n",
- " 40105 | \n",
+ " 167 | \n",
" NaN | \n",
- " Puerto Rico Highway and Transportation Authori... | \n",
- " San Juan | \n",
- " 671fb05927de6f93c0b7fbc231ba0c3f | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 30 | \n",
- " 40269 | \n",
" NaN | \n",
" NaN | \n",
- " Municipality of Anasco | \n",
- " Anasco | \n",
- " 727e463669495f24983f88e0c1ebc84e | \n",
- " 2021.0 | \n",
- " 40269 | \n",
- " 40269 | \n",
" NaN | \n",
- " Municipality of Añasco | \n",
- " Anasco | \n",
- " bf314c9d218b6b33879aca0e15a0aec6 | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 63 | \n",
- " 4R03-41133 | \n",
- " 4R03-115 | \n",
- " Georgia Department of Transportation | \n",
- " Coweta County | \n",
- " Newnan | \n",
- " a2b14dc5773bf3c0ad04dfe1757d3be6 | \n",
- " 2021.0 | \n",
- " 41133 | \n",
- " 41133 | \n",
" NaN | \n",
- " Coweta County | \n",
- " Newnan | \n",
- " dd0a411799e522f52608bb1977d5a149 | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 2 | \n",
- " 4R05-44979 | \n",
" NaN | \n",
- " Mississippi Department of Transportation | \n",
- " CENTRAL MISSISSIPPI INC | \n",
- " Winona | \n",
- " a526f2abfd1780150ba2b794124d7343 | \n",
- " 2021.0 | \n",
- " 44979 | \n",
- " 44979 | \n",
- " Mississippi Department of Transportation | \n",
- " Central Mississippi, Incorporated | \n",
- " Winona | \n",
- " b1c19267d796b92f9da7b0491ac539e7 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " left_only | \n",
+ "
\n",
+ " \n",
+ "\n",
+ ""
+ ],
+ "text/plain": [
+ " ntd_id_x legacy_ntd_id reported_by_name_x \\\n",
+ "0 5R02-50399 5R02-004 Indiana Department of Transportation \n",
+ "1 167 0T19 NaN \n",
+ "\n",
+ " agency_name_x city_x \\\n",
+ "0 Fayette Community Commissioners Connersville \n",
+ "1 Native Village of Crooked Creek Crooked Creek \n",
+ "\n",
+ " key_x year_x ntd_id_no_prefix ntd_id_y \\\n",
+ "0 eeae713c46c405e3c8d4f001df04ab08 2021.0 50399 50399 \n",
+ "1 5f174c276fcb5bdafe25d2d81bc90dc9 2021.0 167 NaN \n",
+ "\n",
+ " reported_by_name_y \\\n",
+ "0 Indiana Department of Transportation \n",
+ "1 NaN \n",
+ "\n",
+ " agency_name_y city_y \\\n",
+ "0 Fayette County Council Agency on Aging and Aged Connersville \n",
+ "1 NaN NaN \n",
+ "\n",
+ " key_y year_y _merge \n",
+ "0 4e3cd53439c5b16a8db255353ab5f452 2022.0 both \n",
+ "1 NaN NaN left_only "
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "m3.head(2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ca15336a-42d3-4d8e-94c1-9142bd4f5394",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "### Parsing `ntd_id` into a no-prefix version can help \n",
+ "\n",
+ "If we are going to remove the prefix...we could do this earlier and hopefully get more to merge. Although, this does mean that we are left with variations on `agency_name` and `reported_by_name`, which still needs to make it into our crosswalk, even if we do not use it to merge.\n",
+ "\n",
+ "Left with a batch of about 60 to reconcile manually."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "id": "92906541-2a8f-46aa-aae0-7bc60d892fe1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m1_table = m1.loc[m1['_merge'] == \"both\", ['ntd_id', 'reported_by_name','legacy_ntd_id','agency_name','city']]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "id": "b18cdc3d-cedf-43c4-bbf5-e084e24d5a3b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
"
\n",
+ " \n",
+ " \n",
" \n",
- " 40 | \n",
- " 50193 | \n",
- " 5193 | \n",
- " NaN | \n",
- " Enterprise Rideshare - Michigan | \n",
- " Farmington Hills | \n",
- " fb118835888478e280646363880222b4 | \n",
- " 2021.0 | \n",
- " 50193 | \n",
- " 50193 | \n",
+ " 1 | \n",
+ " 11239 | \n",
" NaN | \n",
- " Michigan Department of Transportation | \n",
" NaN | \n",
- " 5db618a2d5318c4dff590a53f339688a | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 101 | \n",
- " 5R02-50230 | \n",
- " 5R02-011 | \n",
- " Indiana Department of Transportation | \n",
- " Boone County Commissioners | \n",
- " Lebanon | \n",
- " 75778eabc386b8eafba4c9ecdba3400e | \n",
- " 2021.0 | \n",
- " 50230 | \n",
- " 50230 | \n",
- " Indiana Department of Transportation | \n",
- " Boone County Senior Services | \n",
- " Lebanon | \n",
- " 51057c0cb82672b5f5c59afd1e9217ef | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 25 | \n",
- " 5R02-50246 | \n",
- " 5R02-012 | \n",
- " Indiana Department of Transportation | \n",
- " Marshall County Commissioners | \n",
- " Plymouth | \n",
- " 77570092c7163f61fcf99dd2fbaa8d16 | \n",
- " 2021.0 | \n",
- " 50246 | \n",
- " 50246 | \n",
- " Indiana Department of Transportation | \n",
- " Marshall County Council on Aging | \n",
- " Plymouth | \n",
- " 67f53fd56b632e5a1edbcbc9beb819cb | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 49 | \n",
- " 5R02-50248 | \n",
- " 5R02-043 | \n",
- " Indiana Department of Transportation | \n",
- " Steuben County Commissioners | \n",
- " Angola | \n",
- " 09864a8b4fdbf162b3d9a0434a63efa9 | \n",
- " 2021.0 | \n",
- " 50248 | \n",
- " 50248 | \n",
- " Indiana Department of Transportation | \n",
- " Steuben County Council on Aging | \n",
- " Angola | \n",
- " 68c0951ae10e643259fbad16a68b0501 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " Hyannis Harbor Tours, Inc. | \n",
+ " Hyannis | \n",
"
\n",
" \n",
- " 96 | \n",
- " 5R02-50276 | \n",
- " 5R02-032 | \n",
- " Indiana Department of Transportation | \n",
- " Southern Indiana Development Commission | \n",
- " Loogootee | \n",
- " 075d2df66f3c9d3f4b306cec2d8ecf88 | \n",
- " 2021.0 | \n",
- " 50276 | \n",
- " 50276 | \n",
- " Indiana Department of Transportation | \n",
- " Four Rivers Resource Services | \n",
- " Loogootee | \n",
- " e8c4337e4072dcff70836d5aa72d6d0e | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 2 | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " 21 | \n",
+ " Whatcom Transportation Authority | \n",
+ " Bellingham | \n",
"
\n",
" \n",
- " 52 | \n",
- " 5R02-50280 | \n",
- " 5R02-042 | \n",
- " Indiana Department of Transportation | \n",
- " Rush County Commissioners | \n",
- " Rushville | \n",
- " 3e35f464fafa37874c5479eba6a8de39 | \n",
- " 2021.0 | \n",
- " 50280 | \n",
- " 50280 | \n",
- " Indiana Department of Transportation | \n",
- " Rush County Senior Services | \n",
- " Rushville | \n",
- " d3ffb9b7a07a22227815c8c850384777 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 6 | \n",
+ " 30010 | \n",
+ " NaN | \n",
+ " 3010 | \n",
+ " Lehigh and Northampton Transportation Authority | \n",
+ " Allentown | \n",
"
\n",
" \n",
- " 75 | \n",
- " 5R02-50281 | \n",
- " 5R02-002 | \n",
- " Indiana Department of Transportation | \n",
- " Cass County Commissioners | \n",
- " Logansport | \n",
- " 10cea1f86819cd03704ddad23d6ed6b2 | \n",
- " 2021.0 | \n",
- " 50281 | \n",
- " 50281 | \n",
- " Indiana Department of Transportation | \n",
- " Cass County Council on Aging | \n",
- " Logansport | \n",
- " 021a9930cc37edb3d2b04e0f47c0518f | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 7 | \n",
+ " 30041 | \n",
+ " NaN | \n",
+ " 3041 | \n",
+ " Board of Commissioners of Allegany County Mary... | \n",
+ " Cumberland | \n",
"
\n",
" \n",
- " 14 | \n",
- " 5R02-50289 | \n",
- " 5R02-016 | \n",
- " Indiana Department of Transportation | \n",
- " Kosciusko County Commissioners | \n",
- " Warsaw | \n",
- " 7d5e5c112a450de2882acc863ffbf347 | \n",
- " 2021.0 | \n",
- " 50289 | \n",
- " 50289 | \n",
- " Indiana Department of Transportation | \n",
- " Cardinal Services | \n",
- " Warsaw | \n",
- " 4e91b967ea275a6f3bd9d748e0755299 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 8 | \n",
+ " 30201 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " City of Baltimore | \n",
+ " Baltimore | \n",
"
\n",
" \n",
- " 54 | \n",
- " 5R02-50305 | \n",
- " 5R02-044 | \n",
- " Indiana Department of Transportation | \n",
- " LaGrange County Commissioners | \n",
- " Lagrange | \n",
- " 46e1f9e708e4bdc8dfc3b8b11b12c58f | \n",
- " 2021.0 | \n",
- " 50305 | \n",
- " 50305 | \n",
- " Indiana Department of Transportation | \n",
- " LaGrange County Council on Aging | \n",
- " Lagrange | \n",
- " 06013a9919f57f65e7e19604d97fd876 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
"
\n",
" \n",
- " 68 | \n",
- " 5R02-50307 | \n",
- " 5R02-037 | \n",
- " Indiana Department of Transportation | \n",
- " Jay County Commissioners | \n",
- " Yorktown | \n",
- " e62a7d09f50c6891a7f7b49711ceded0 | \n",
- " 2021.0 | \n",
- " 50307 | \n",
- " 50307 | \n",
- " Indiana Department of Transportation | \n",
- " LifeStream Services | \n",
- " Yorktown | \n",
- " 24ad33959cbe7492784bed1b19148448 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 2999 | \n",
+ " 50020 | \n",
+ " NaN | \n",
+ " 5020 | \n",
+ " City of Springfield, Ohio | \n",
+ " Springfield | \n",
"
\n",
" \n",
- " 94 | \n",
- " 5R02-50308 | \n",
- " 5R02-020 | \n",
- " Indiana Department of Transportation | \n",
- " Monroe County Commissioners | \n",
- " Ellettsville | \n",
- " 74f575bf059841b71a869fd3efd66f4f | \n",
- " 2021.0 | \n",
- " 50308 | \n",
- " 50308 | \n",
- " Indiana Department of Transportation | \n",
- " Area 10 Council on Aging of Monroe County | \n",
- " Ellettsville | \n",
- " 00d4f9e499a70f66a8a72c0f4c42d408 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 3000 | \n",
+ " 50047 | \n",
+ " NaN | \n",
+ " 5047 | \n",
+ " Bloomington-Normal Public Transit System | \n",
+ " Normal | \n",
"
\n",
" \n",
- " 10 | \n",
- " 5R02-50324 | \n",
- " 5R02-026 | \n",
- " Indiana Department of Transportation | \n",
- " Historic Hoosier Hills | \n",
- " Dillsboro | \n",
- " e6710aa2c700355db16170c3b148a71d | \n",
- " 2021.0 | \n",
- " 50324 | \n",
- " 50324 | \n",
- " Indiana Department of Transportation | \n",
- " LifeTime Resources | \n",
- " Dillsboro | \n",
- " 8b9f8b88b29442184defa14305fd5cbf | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 3007 | \n",
+ " 66194 | \n",
+ " NaN | \n",
+ " 6T14 | \n",
+ " Cheyenne & Arapaho Tribes | \n",
+ " Concho | \n",
"
\n",
" \n",
- " 37 | \n",
- " 5R02-50330 | \n",
- " 5R02-041 | \n",
- " Indiana Department of Transportation | \n",
- " DeKalb County Commissioners | \n",
- " Auburn | \n",
- " ea5f5035fe8120cb93533e55883674df | \n",
- " 2021.0 | \n",
- " 50330 | \n",
- " 50330 | \n",
- " Indiana Department of Transportation | \n",
- " DeKalb County Council on Aging | \n",
- " Auburn | \n",
- " f86b7873b1bf7f66462e1126e2e6cba8 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 3009 | \n",
+ " 70032 | \n",
+ " NaN | \n",
+ " 7032 | \n",
+ " City of St. Joseph, Missouri | \n",
+ " Saint Joseph | \n",
"
\n",
" \n",
- " 41 | \n",
- " 5R02-50347 | \n",
- " 5R02-031 | \n",
- " Indiana Department of Transportation | \n",
- " Harrison County Commissioners | \n",
- " Georgetown | \n",
- " 8af031820471773675f7d78ef0ffbb04 | \n",
- " 2021.0 | \n",
- " 50347 | \n",
- " 50347 | \n",
- " Indiana Department of Transportation | \n",
- " Blue River Services | \n",
- " Corydon | \n",
- " 5c6ef7763f8d3c56e2116e821a31f869 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 3016 | \n",
+ " 9R03 | \n",
+ " NaN | \n",
+ " 9R03 | \n",
+ " Hawaii Department of Transportation | \n",
+ " Honolulu | \n",
"
\n",
- " \n",
- " 82 | \n",
- " 5R02-50361 | \n",
- " 5R02-010 | \n",
- " Indiana Department of Transportation | \n",
- " Huntington County Commissioners | \n",
- " Huntington | \n",
- " 3f28a1bf0e4b0718de390209ebd536bb | \n",
- " 2021.0 | \n",
- " 50361 | \n",
- " 50361 | \n",
- " Indiana Department of Transportation | \n",
- " Huntington County Council on Aging | \n",
- " Huntington | \n",
- " edbf0f943976f37a77cff85b99004094 | \n",
- " 2022.0 | \n",
- " both | \n",
+ "
\n",
+ "
\n",
+ "
1130 rows × 5 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ntd_id reported_by_name legacy_ntd_id \\\n",
+ "1 11239 NaN NaN \n",
+ "2 21 NaN 21 \n",
+ "6 30010 NaN 3010 \n",
+ "7 30041 NaN 3041 \n",
+ "8 30201 NaN NaN \n",
+ "... ... ... ... \n",
+ "2999 50020 NaN 5020 \n",
+ "3000 50047 NaN 5047 \n",
+ "3007 66194 NaN 6T14 \n",
+ "3009 70032 NaN 7032 \n",
+ "3016 9R03 NaN 9R03 \n",
+ "\n",
+ " agency_name city \n",
+ "1 Hyannis Harbor Tours, Inc. Hyannis \n",
+ "2 Whatcom Transportation Authority Bellingham \n",
+ "6 Lehigh and Northampton Transportation Authority Allentown \n",
+ "7 Board of Commissioners of Allegany County Mary... Cumberland \n",
+ "8 City of Baltimore Baltimore \n",
+ "... ... ... \n",
+ "2999 City of Springfield, Ohio Springfield \n",
+ "3000 Bloomington-Normal Public Transit System Normal \n",
+ "3007 Cheyenne & Arapaho Tribes Concho \n",
+ "3009 City of St. Joseph, Missouri Saint Joseph \n",
+ "3016 Hawaii Department of Transportation Honolulu \n",
+ "\n",
+ "[1130 rows x 5 columns]"
+ ]
+ },
+ "execution_count": 18,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "m1_table"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cd6e7fa6-1e25-4d61-bdd3-fcd932b3a623",
+ "metadata": {},
+ "source": [
+ "### Merging all the crosswalks to create one table"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "id": "74bd172e-2585-4e9b-9bde-c3de85ef05e1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m1_table['ntd_id_2021'] = m1_table['ntd_id']"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "id": "7c82c4cc-d32f-4803-a487-f8cda9f41db0",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m1_table.rename(columns={'ntd_id' : 'ntd_id_2022'}, inplace = True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "9962b97f-8254-422d-a7aa-38e9f22cb391",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id_2022 | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
+ " ntd_id_2021 | \n",
"
\n",
+ " \n",
+ " \n",
" \n",
- " 11 | \n",
- " 5R02-50365 | \n",
- " 5R02-017 | \n",
- " Indiana Department of Transportation | \n",
- " Tippecanoe County Commissioners | \n",
- " Lafayette | \n",
- " 8cff92c1747d39b61233f3134a9b2f50 | \n",
- " 2021.0 | \n",
- " 50365 | \n",
- " 50365 | \n",
- " Indiana Department of Transportation | \n",
- " Area IV Agency on Aging and Community Action P... | \n",
- " Lafayette | \n",
- " a561a8b8df6a37f2dd4f141e4902d346 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 1 | \n",
+ " 11239 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " Hyannis Harbor Tours, Inc. | \n",
+ " Hyannis | \n",
+ " 11239 | \n",
"
\n",
" \n",
- " 76 | \n",
- " 5R02-50387 | \n",
- " 5R02-038 | \n",
- " Indiana Department of Transportation | \n",
- " Union County Commissioners | \n",
- " Liberty | \n",
- " c3620a86511824ab2f1dbc6041261419 | \n",
- " 2021.0 | \n",
- " 50387 | \n",
- " 50387 | \n",
+ " 2 | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " 21 | \n",
+ " Whatcom Transportation Authority | \n",
+ " Bellingham | \n",
+ " 21 | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
+ " 30010 | \n",
+ " NaN | \n",
+ " 3010 | \n",
+ " Lehigh and Northampton Transportation Authority | \n",
+ " Allentown | \n",
+ " 30010 | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " 30041 | \n",
+ " NaN | \n",
+ " 3041 | \n",
+ " Board of Commissioners of Allegany County Mary... | \n",
+ " Cumberland | \n",
+ " 30041 | \n",
+ "
\n",
+ " \n",
+ " 8 | \n",
+ " 30201 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " City of Baltimore | \n",
+ " Baltimore | \n",
+ " 30201 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2999 | \n",
+ " 50020 | \n",
+ " NaN | \n",
+ " 5020 | \n",
+ " City of Springfield, Ohio | \n",
+ " Springfield | \n",
+ " 50020 | \n",
+ "
\n",
+ " \n",
+ " 3000 | \n",
+ " 50047 | \n",
+ " NaN | \n",
+ " 5047 | \n",
+ " Bloomington-Normal Public Transit System | \n",
+ " Normal | \n",
+ " 50047 | \n",
+ "
\n",
+ " \n",
+ " 3007 | \n",
+ " 66194 | \n",
+ " NaN | \n",
+ " 6T14 | \n",
+ " Cheyenne & Arapaho Tribes | \n",
+ " Concho | \n",
+ " 66194 | \n",
+ "
\n",
+ " \n",
+ " 3009 | \n",
+ " 70032 | \n",
+ " NaN | \n",
+ " 7032 | \n",
+ " City of St. Joseph, Missouri | \n",
+ " Saint Joseph | \n",
+ " 70032 | \n",
+ "
\n",
+ " \n",
+ " 3016 | \n",
+ " 9R03 | \n",
+ " NaN | \n",
+ " 9R03 | \n",
+ " Hawaii Department of Transportation | \n",
+ " Honolulu | \n",
+ " 9R03 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
1130 rows × 6 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ntd_id_2022 reported_by_name legacy_ntd_id \\\n",
+ "1 11239 NaN NaN \n",
+ "2 21 NaN 21 \n",
+ "6 30010 NaN 3010 \n",
+ "7 30041 NaN 3041 \n",
+ "8 30201 NaN NaN \n",
+ "... ... ... ... \n",
+ "2999 50020 NaN 5020 \n",
+ "3000 50047 NaN 5047 \n",
+ "3007 66194 NaN 6T14 \n",
+ "3009 70032 NaN 7032 \n",
+ "3016 9R03 NaN 9R03 \n",
+ "\n",
+ " agency_name city \\\n",
+ "1 Hyannis Harbor Tours, Inc. Hyannis \n",
+ "2 Whatcom Transportation Authority Bellingham \n",
+ "6 Lehigh and Northampton Transportation Authority Allentown \n",
+ "7 Board of Commissioners of Allegany County Mary... Cumberland \n",
+ "8 City of Baltimore Baltimore \n",
+ "... ... ... \n",
+ "2999 City of Springfield, Ohio Springfield \n",
+ "3000 Bloomington-Normal Public Transit System Normal \n",
+ "3007 Cheyenne & Arapaho Tribes Concho \n",
+ "3009 City of St. Joseph, Missouri Saint Joseph \n",
+ "3016 Hawaii Department of Transportation Honolulu \n",
+ "\n",
+ " ntd_id_2021 \n",
+ "1 11239 \n",
+ "2 21 \n",
+ "6 30010 \n",
+ "7 30041 \n",
+ "8 30201 \n",
+ "... ... \n",
+ "2999 50020 \n",
+ "3000 50047 \n",
+ "3007 66194 \n",
+ "3009 70032 \n",
+ "3016 9R03 \n",
+ "\n",
+ "[1130 rows x 6 columns]"
+ ]
+ },
+ "execution_count": 21,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "m1_table"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "51922a0e-d710-40b9-b6f3-f4350c89e2af",
+ "metadata": {},
+ "source": [
+ "Filtering rows with successful crosswalk and selecting few columns to concatenate"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "id": "7d30483d-47e9-480b-98c4-50e6143db933",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m2_table = m2.loc[m2['_merge'] == \"both\", ['ntd_id_x', 'reported_by_name','legacy_ntd_id','agency_name','city_y','ntd_id_y']]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "id": "cf74a45d-d6cb-4c65-a2fc-ccab5a218b0a",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m2_table.rename(columns={'ntd_id_y' : 'ntd_id_2022', 'ntd_id_x' : 'ntd_id_2021', 'city_y' : 'city'}, inplace = True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "id": "e28ec20c-2c54-4597-80bd-f2809f6bde0c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "col_order = ['ntd_id_2022', 'reported_by_name','legacy_ntd_id','agency_name','city', 'ntd_id_2021']\n",
+ "m2_table = m2_table[col_order]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "id": "7e4cc94d-37aa-4dee-ab80-fbb7e29ae68c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m3_table = m3.loc[m3['_merge'] == \"both\", ['ntd_id_x', 'reported_by_name_y','legacy_ntd_id','agency_name_y','city_y','ntd_id_y']]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "id": "e8633710-afc4-4b82-a93a-edddf3c97ef5",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m3_table.rename(columns={'ntd_id_y' : 'ntd_id_2022', 'ntd_id_x' : 'ntd_id_2021', 'city_y' : 'city', 'reported_by_name_y' : 'reported_by_name', 'agency_name_y' : 'agency_name' }, inplace = True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "id": "de589814-3e55-459a-81e8-e4403960e788",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m3_table = m3_table[col_order]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f823a67d-496a-4fed-b641-f5ef57da068a",
+ "metadata": {},
+ "source": [
+ "Creating the concatenated table "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "4001a4eb-44c6-4155-bd4c-51b5042c10b6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "crosswalk = pd.concat([m1_table,m2_table,m3_table], axis=0)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "id": "09c4ca75-7432-47ad-bac8-f7967f083f20",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id_2022 | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
+ " ntd_id_2021 | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 1 | \n",
+ " 11239 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " Hyannis Harbor Tours, Inc. | \n",
+ " Hyannis | \n",
+ " 11239 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " 21 | \n",
+ " Whatcom Transportation Authority | \n",
+ " Bellingham | \n",
+ " 21 | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
+ " 30010 | \n",
+ " NaN | \n",
+ " 3010 | \n",
+ " Lehigh and Northampton Transportation Authority | \n",
+ " Allentown | \n",
+ " 30010 | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " 30041 | \n",
+ " NaN | \n",
+ " 3041 | \n",
+ " Board of Commissioners of Allegany County Mary... | \n",
+ " Cumberland | \n",
+ " 30041 | \n",
+ "
\n",
+ " \n",
+ " 8 | \n",
+ " 30201 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " City of Baltimore | \n",
+ " Baltimore | \n",
+ " 30201 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 84 | \n",
+ " 50468 | \n",
" Indiana Department of Transportation | \n",
- " Union County Council on Aging | \n",
- " Liberty | \n",
- " e5314f96a7b7c1c48612fa62b2f88a7c | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 5R02-039 | \n",
+ " Whitley County Council on Aging | \n",
+ " Columbia City | \n",
+ " 5R02-50468 | \n",
"
\n",
" \n",
- " 26 | \n",
- " 5R02-50389 | \n",
- " 5R02-019 | \n",
+ " 87 | \n",
+ " 50483 | \n",
" Indiana Department of Transportation | \n",
- " Orange County Commissioners | \n",
- " Paoli | \n",
- " 68cce0722e9a67b873de8d28850aa9aa | \n",
- " 2021.0 | \n",
- " 50389 | \n",
- " 50389 | \n",
+ " 5R02-005 | \n",
+ " Franklin County Senior Services | \n",
+ " Brookville | \n",
+ " 5R02-50483 | \n",
+ "
\n",
+ " \n",
+ " 94 | \n",
+ " 50308 | \n",
" Indiana Department of Transportation | \n",
- " Orange County First Chance Center | \n",
- " Paoli | \n",
- " 7ac967575d36aa7c14596cfd5dc679c7 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 5R02-020 | \n",
+ " Area 10 Council on Aging of Monroe County | \n",
+ " Ellettsville | \n",
+ " 5R02-50308 | \n",
"
\n",
" \n",
- " 59 | \n",
- " 5R02-50392 | \n",
- " 5R02-024 | \n",
+ " 96 | \n",
+ " 50276 | \n",
" Indiana Department of Transportation | \n",
- " Knox County Commissioners | \n",
- " Vincennes | \n",
- " 33a64f3c79c604d28a89374170b0700a | \n",
- " 2021.0 | \n",
- " 50392 | \n",
- " 50392 | \n",
+ " 5R02-032 | \n",
+ " Four Rivers Resource Services | \n",
+ " Loogootee | \n",
+ " 5R02-50276 | \n",
+ "
\n",
+ " \n",
+ " 101 | \n",
+ " 50230 | \n",
" Indiana Department of Transportation | \n",
- " YMCA of Vincennes | \n",
- " Vincennes | \n",
- " 13d170d217ad0cf7860e62ce13651004 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 5R02-011 | \n",
+ " Boone County Senior Services | \n",
+ " Lebanon | \n",
+ " 5R02-50230 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
2960 rows × 6 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ntd_id_2022 reported_by_name legacy_ntd_id \\\n",
+ "1 11239 NaN NaN \n",
+ "2 21 NaN 21 \n",
+ "6 30010 NaN 3010 \n",
+ "7 30041 NaN 3041 \n",
+ "8 30201 NaN NaN \n",
+ ".. ... ... ... \n",
+ "84 50468 Indiana Department of Transportation 5R02-039 \n",
+ "87 50483 Indiana Department of Transportation 5R02-005 \n",
+ "94 50308 Indiana Department of Transportation 5R02-020 \n",
+ "96 50276 Indiana Department of Transportation 5R02-032 \n",
+ "101 50230 Indiana Department of Transportation 5R02-011 \n",
+ "\n",
+ " agency_name city \\\n",
+ "1 Hyannis Harbor Tours, Inc. Hyannis \n",
+ "2 Whatcom Transportation Authority Bellingham \n",
+ "6 Lehigh and Northampton Transportation Authority Allentown \n",
+ "7 Board of Commissioners of Allegany County Mary... Cumberland \n",
+ "8 City of Baltimore Baltimore \n",
+ ".. ... ... \n",
+ "84 Whitley County Council on Aging Columbia City \n",
+ "87 Franklin County Senior Services Brookville \n",
+ "94 Area 10 Council on Aging of Monroe County Ellettsville \n",
+ "96 Four Rivers Resource Services Loogootee \n",
+ "101 Boone County Senior Services Lebanon \n",
+ "\n",
+ " ntd_id_2021 \n",
+ "1 11239 \n",
+ "2 21 \n",
+ "6 30010 \n",
+ "7 30041 \n",
+ "8 30201 \n",
+ ".. ... \n",
+ "84 5R02-50468 \n",
+ "87 5R02-50483 \n",
+ "94 5R02-50308 \n",
+ "96 5R02-50276 \n",
+ "101 5R02-50230 \n",
+ "\n",
+ "[2960 rows x 6 columns]"
+ ]
+ },
+ "execution_count": 29,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "crosswalk"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "889084ff-cf7b-4776-924a-1a5b8f2ad3b3",
+ "metadata": {},
+ "source": [
+ "#### Checking for duplicated rows"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "62dd8c51-e1a5-4ada-8e48-3b5245500895",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "duplicated_rows = crosswalk.duplicated()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "id": "9d5cea88-0a30-49b7-b5a4-c1fa796c886f",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "duplicated_rows:\n",
+ "Empty DataFrame\n",
+ "Columns: [ntd_id_2022, reported_by_name, legacy_ntd_id, agency_name, city, ntd_id_2021]\n",
+ "Index: []\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(\"duplicated_rows:\")\n",
+ "print(crosswalk[duplicated_rows])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "id": "49cfc12a-9cca-4639-91cc-2107286634b5",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "duplicated_rows_subset = crosswalk.duplicated(subset = ['ntd_id_2022', 'agency_name', 'reported_by_name'])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "id": "9bb49836-cbf2-446a-88c2-a4368b907789",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "duplicated_rows_subset:\n",
+ "Empty DataFrame\n",
+ "Columns: [ntd_id_2022, reported_by_name, legacy_ntd_id, agency_name, city, ntd_id_2021]\n",
+ "Index: []\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(\"duplicated_rows_subset:\")\n",
+ "print(crosswalk[duplicated_rows_subset])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ab10ebf-297e-4811-a1e1-51e6c25ab4bc",
+ "metadata": {},
+ "source": [
+ "#### Manual crosswalk for the remaining ntd_ids\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bbd7d5f1-0321-4f18-b886-8debda0b01e9",
+ "metadata": {},
+ "source": [
+ "- Pioneer valley transit authority intercity bus reported by Massachusetts Department of Transportation has incorrect ntd_id (checked from the NTD profile data)\n",
+ "- Some agencies do not have 2021 data but has 2020 data. \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "id": "334fba5f-30ea-48aa-88cf-a728c517810d",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "m4_table = pd.read_csv(\n",
+ " f\"{GCS_PATH}{FILE_NAMEb}\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "id": "89d9788b-95f2-46ec-a458-1b7c6a18c97b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id_2022 | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
+ " ntd_id_2021 | \n",
+ " Remarks | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 231 | \n",
+ " NaN | \n",
+ " 0T33 | \n",
+ " Confederated Tribes of Warm Springs | \n",
+ " Warm Springs | \n",
+ " NaN | \n",
+ " No 2021 data | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 90306 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " Stanislaus Regional Transit Authority | \n",
+ " Modesto | \n",
+ " NaN | \n",
+ " the county doesn’t have data after 2021 so cou... | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ntd_id_2022 reported_by_name legacy_ntd_id \\\n",
+ "0 231 NaN 0T33 \n",
+ "1 90306 NaN NaN \n",
+ "\n",
+ " agency_name city ntd_id_2021 \\\n",
+ "0 Confederated Tribes of Warm Springs Warm Springs NaN \n",
+ "1 Stanislaus Regional Transit Authority Modesto NaN \n",
+ "\n",
+ " Remarks \n",
+ "0 No 2021 data \n",
+ "1 the county doesn’t have data after 2021 so cou... "
+ ]
+ },
+ "execution_count": 35,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "m4_table.head(2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "id": "c39ad008-3c93-48e2-9f79-06ea57cc8a42",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "crosswalk['Remarks'] = pd.Series(dtype=float)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "id": "444199a9-4ee5-4dc4-9078-372bc073f8bf",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id_2022 | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
+ " ntd_id_2021 | \n",
+ " Remarks | \n",
"
\n",
+ " \n",
+ " \n",
" \n",
- " 0 | \n",
- " 5R02-50399 | \n",
- " 5R02-004 | \n",
- " Indiana Department of Transportation | \n",
- " Fayette Community Commissioners | \n",
- " Connersville | \n",
- " eeae713c46c405e3c8d4f001df04ab08 | \n",
- " 2021.0 | \n",
- " 50399 | \n",
- " 50399 | \n",
- " Indiana Department of Transportation | \n",
- " Fayette County Council Agency on Aging and Aged | \n",
- " Connersville | \n",
- " 4e3cd53439c5b16a8db255353ab5f452 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 1 | \n",
+ " 11239 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " Hyannis Harbor Tours, Inc. | \n",
+ " Hyannis | \n",
+ " 11239 | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 42 | \n",
- " 5R02-50403 | \n",
- " 5R02-029 | \n",
- " Indiana Department of Transportation | \n",
- " Wells County Commissioners | \n",
- " Bluffton | \n",
- " 0959996691b94d855104db0d33b2e1c1 | \n",
- " 2021.0 | \n",
- " 50403 | \n",
- " 50403 | \n",
- " Indiana Department of Transportation | \n",
- " Wells County Council on Aging | \n",
- " Bluffton | \n",
- " 0686e12cdf0e5053047e63ff96e7c83b | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 2 | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " 21 | \n",
+ " Whatcom Transportation Authority | \n",
+ " Bellingham | \n",
+ " 21 | \n",
+ " NaN | \n",
"
\n",
- " \n",
- " 15 | \n",
- " 5R02-50422 | \n",
- " 5R02-021 | \n",
- " Indiana Department of Transportation | \n",
- " Noble County Commissioners | \n",
- " Albion | \n",
- " 019f5b9e0cc9b402ee30dfbc52e70889 | \n",
- " 2021.0 | \n",
- " 50422 | \n",
- " 50422 | \n",
- " Indiana Department of Transportation | \n",
- " Noble County Council on Aging | \n",
- " Albion | \n",
- " 5ef553988ed5ffe7abf562f9700c5e68 | \n",
- " 2022.0 | \n",
- " both | \n",
+ "
\n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ntd_id_2022 reported_by_name legacy_ntd_id \\\n",
+ "1 11239 NaN NaN \n",
+ "2 21 NaN 21 \n",
+ "\n",
+ " agency_name city ntd_id_2021 Remarks \n",
+ "1 Hyannis Harbor Tours, Inc. Hyannis 11239 NaN \n",
+ "2 Whatcom Transportation Authority Bellingham 21 NaN "
+ ]
+ },
+ "execution_count": 37,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "crosswalk.head(2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "747884de-7da6-4100-b8d1-d002a9e8bb13",
+ "metadata": {},
+ "source": [
+ "### Final Concatenation"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "id": "58fcd1e0-0940-4456-9ef8-eab0be5f9d9c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "final_crosswalk = pd.concat([crosswalk, m4_table], axis=0)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "id": "67689071-abb7-4225-8c83-fac5ea275960",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ntd_id_2022 | \n",
+ " reported_by_name | \n",
+ " legacy_ntd_id | \n",
+ " agency_name | \n",
+ " city | \n",
+ " ntd_id_2021 | \n",
+ " Remarks | \n",
+ " ntd_id_2022 | \n",
+ " Remarks | \n",
"
\n",
+ " \n",
+ " \n",
" \n",
- " 38 | \n",
- " 5R02-50441 | \n",
- " 5R02-030 | \n",
- " Indiana Department of Transportation | \n",
- " Wabash County Commissioners | \n",
- " Wabash | \n",
- " 95e83cbe96f8b149cf091a688e4efd7e | \n",
- " 2021.0 | \n",
- " 50441 | \n",
- " 50441 | \n",
- " Indiana Department of Transportation | \n",
- " Living Wells in Wabash County Council on Aging | \n",
- " Wabash | \n",
- " 2547e2ebe22ddcb01ae9adedd3d38a4b | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 1 | \n",
+ " 11239 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " Hyannis Harbor Tours, Inc. | \n",
+ " Hyannis | \n",
+ " 11239 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 74 | \n",
- " 5R02-50444 | \n",
- " 5R02-028 | \n",
- " Indiana Department of Transportation | \n",
- " White County Commissioners | \n",
- " Monticello | \n",
- " 3e9bd5cfa85e2e200430e73cd794e4eb | \n",
- " 2021.0 | \n",
- " 50444 | \n",
- " 50444 | \n",
- " Indiana Department of Transportation | \n",
- " White County Council on Aging | \n",
- " Monticello | \n",
- " 91d0c6fd3810f8971287135ca843990d | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 2 | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " 21 | \n",
+ " Whatcom Transportation Authority | \n",
+ " Bellingham | \n",
+ " 21 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 7 | \n",
- " 5R02-50454 | \n",
- " 5R02-023 | \n",
- " Indiana Department of Transportation | \n",
- " Miami County Commissioners | \n",
- " Peru | \n",
- " e0b549ebd3208c1adf7e8daff9b02e56 | \n",
- " 2021.0 | \n",
- " 50454 | \n",
- " 50454 | \n",
- " Indiana Department of Transportation | \n",
- " Miami County YMCA | \n",
- " Peru | \n",
- " 8a1db7fdef4bd99effcad121ce960a7a | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 6 | \n",
+ " 30010 | \n",
+ " NaN | \n",
+ " 3010 | \n",
+ " Lehigh and Northampton Transportation Authority | \n",
+ " Allentown | \n",
+ " 30010 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 84 | \n",
- " 5R02-50468 | \n",
- " 5R02-039 | \n",
- " Indiana Department of Transportation | \n",
- " Whitley County Commissioners | \n",
- " Columbia City | \n",
- " 518ace07cb87072ec541dc7fef24e6f7 | \n",
- " 2021.0 | \n",
- " 50468 | \n",
- " 50468 | \n",
- " Indiana Department of Transportation | \n",
- " Whitley County Council on Aging | \n",
- " Columbia City | \n",
- " 0b058ae9f5d5a1e9780257c981a6b91c | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 7 | \n",
+ " 30041 | \n",
+ " NaN | \n",
+ " 3041 | \n",
+ " Board of Commissioners of Allegany County Mary... | \n",
+ " Cumberland | \n",
+ " 30041 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 87 | \n",
- " 5R02-50483 | \n",
- " 5R02-005 | \n",
- " Indiana Department of Transportation | \n",
- " Franklin County Commissioners | \n",
- " Brookville | \n",
- " 588365cb83b4b249b502b797bf217299 | \n",
- " 2021.0 | \n",
- " 50483 | \n",
- " 50483 | \n",
- " Indiana Department of Transportation | \n",
- " Franklin County Senior Services | \n",
- " Brookville | \n",
- " b76b01f10dcbcd6616d05ff50d86b353 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 8 | \n",
+ " 30201 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " City of Baltimore | \n",
+ " Baltimore | \n",
+ " 30201 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 60 | \n",
- " 5R02-50484 | \n",
- " 5R02-006 | \n",
- " Indiana Department of Transportation | \n",
- " Fulton County Commissioners | \n",
- " Rochester | \n",
- " c15d9675ebd9e79a1e9b21ce171c907c | \n",
- " 2021.0 | \n",
- " 50484 | \n",
- " 50484 | \n",
- " Indiana Department of Transportation | \n",
- " Fulton County Council on Aging | \n",
- " Rochester | \n",
- " 938d6b2a2c0297e4b2d77ddece412a5d | \n",
- " 2022.0 | \n",
- " both | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
"
\n",
" \n",
" 47 | \n",
- " 5R02-50499 | \n",
- " 5R02-003 | \n",
- " Indiana Department of Transportation | \n",
- " Clinton County Commissioners | \n",
- " Frankfort | \n",
- " ae316730728efa5b437e71f8a123e510 | \n",
- " 2021.0 | \n",
- " 50499 | \n",
- " 50499 | \n",
- " Indiana Department of Transportation | \n",
- " Paul Philippe Resource Center | \n",
- " Frankfort | \n",
- " 0ea094bd3b3b713d00eb383fec67b849 | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 77 | \n",
- " 60127 | \n",
- " 6127 | \n",
" NaN | \n",
- " Plaquemines Parish Government | \n",
- " Belle Chasse | \n",
- " 507c162cbce391ef4ac5db7e7e420b0d | \n",
- " 2021.0 | \n",
- " 60127 | \n",
- " 60127 | \n",
- " Louisiana Department of Transportation | \n",
- " Plaquemines Parish Government | \n",
- " Belle Chasse | \n",
- " 68bcb32f91c2e25018dfff92f2f3739a | \n",
- " 2022.0 | \n",
- " both | \n",
- "
\n",
- " \n",
- " 4 | \n",
- " 6R04-60191 | \n",
- " 6R04-002 | \n",
- " Oklahoma Department of Transportation | \n",
- " Little Dixie Community Action Agency, Inc. | \n",
- " Hugo | \n",
- " e60a5ce844c6fc0427a182ccb89190a4 | \n",
- " 2021.0 | \n",
- " 60191 | \n",
- " 60191 | \n",
- " Oklahoma Department of Transportation | \n",
- " LIFT COMMUNITY ACTION AGENCY INC LIFT | \n",
- " Hugo | \n",
- " 3bfbdeaa0429bd8cd0fddc2f59892661 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " Arizona Department of Transportation | \n",
+ " NaN | \n",
+ " New Horizons Disability Empowerment Center | \n",
+ " Prescott Valley | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 99463.0 | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 43 | \n",
- " A0025-66344 | \n",
+ " 48 | \n",
" NaN | \n",
- " North Central Texas Council of Governments | \n",
- " Northeast Transportation Services | \n",
- " Fort Worth | \n",
- " 6078b40173c8a29881a4e217181547d6 | \n",
- " 2021.0 | \n",
- " 66344 | \n",
- " 66344 | \n",
+ " Utah Department of Transportation | \n",
+ " NaN | \n",
+ " Kane County Senior Citizens Improvement Corp | \n",
+ " Kanab | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 88253.0 | \n",
" NaN | \n",
- " Northeast Transportation Services | \n",
- " Fort Worth | \n",
- " d7f9a702076e56039e38b4deb3798b49 | \n",
- " 2022.0 | \n",
- " both | \n",
"
\n",
" \n",
- " 29 | \n",
- " 7R03-77086 | \n",
+ " 49 | \n",
+ " NaN | \n",
+ " Arizona Department of Transportation | \n",
+ " NaN | \n",
+ " Saguaro Foundation Community Living Programs | \n",
+ " Yuma | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 99462.0 | \n",
" NaN | \n",
- " Missouri Department of Transportation | \n",
- " NEW BOURBON REGIONAL PORT AUTH | \n",
- " Perryville | \n",
- " 76f5a9389da3eb3cf3060057c880c3f6 | \n",
- " 2021.0 | \n",
- " 77086 | \n",
- " 77086 | \n",
- " Missouri Department of Transportation | \n",
- " New Bourbon Regional Port Authority | \n",
- " Perryville | \n",
- " 66ac0917e90aea3a1df01b4303967ec3 | \n",
- " 2022.0 | \n",
- " both | \n",
"
\n",
" \n",
- " 27 | \n",
- " 8R01-80118 | \n",
- " 8R01-036 | \n",
- " Colorado Department of Transportation | \n",
- " Wet Mountain Valley Rotary Community Service Inc. | \n",
- " Westcliffe | \n",
- " 64c2d7f92534e463125d4f208bf04f04 | \n",
- " 2021.0 | \n",
- " 80118 | \n",
- " 80118 | \n",
- " Colorado Department of Transportation | \n",
- " Wet Mountain Valley Rotary Community Service, ... | \n",
- " Westcliffe | \n",
- " a2a83e9259a69aec792f7b67e3292d06 | \n",
- " 2022.0 | \n",
- " both | \n",
+ " 50 | \n",
+ " NaN | \n",
+ " Arizona Department of Transportation | \n",
+ " NaN | \n",
+ " Town of springerville AZ | \n",
+ " Springerville | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 99467.0 | \n",
+ " NaN | \n",
"
\n",
" \n",
- " 64 | \n",
- " 8R05-80127 | \n",
- " 8R05-046 | \n",
- " Wyoming Department of Transportation | \n",
- " Shoshoni Senior Citizens | \n",
+ " 51 | \n",
+ " NaN | \n",
+ " West Virginia Department of Transportation | \n",
+ " NaN | \n",
+ " Greenbrier Co. Committee on Aging, Inc. | \n",
+ " Rupert | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 31048.0 | \n",
" NaN | \n",
- " 783e80db49b656ed4e4eb77c4c25e974 | \n",
- " 2021.0 | \n",
- " 80127 | \n",
- " 80127 | \n",
- " Wyoming Department of Transportation | \n",
- " Shoshoni Senior Citizens Center | \n",
- " Shoshoni | \n",
- " a3674c39d8e7ff4026b491956dc20193 | \n",
- " 2022.0 | \n",
- " both | \n",
"
\n",
" \n",
"
\n",
+ "
3012 rows × 9 columns
\n",
"
"
],
"text/plain": [
- " ntd_id_x legacy_ntd_id reported_by_name_x \\\n",
- "61 11238 NaN NaN \n",
- "56 3R03-30130 3R03-010 Maryland Department of Transportation \n",
- "24 40105 4105 NaN \n",
- "30 40269 NaN NaN \n",
- "63 4R03-41133 4R03-115 Georgia Department of Transportation \n",
- "2 4R05-44979 NaN Mississippi Department of Transportation \n",
- "40 50193 5193 NaN \n",
- "101 5R02-50230 5R02-011 Indiana Department of Transportation \n",
- "25 5R02-50246 5R02-012 Indiana Department of Transportation \n",
- "49 5R02-50248 5R02-043 Indiana Department of Transportation \n",
- "96 5R02-50276 5R02-032 Indiana Department of Transportation \n",
- "52 5R02-50280 5R02-042 Indiana Department of Transportation \n",
- "75 5R02-50281 5R02-002 Indiana Department of Transportation \n",
- "14 5R02-50289 5R02-016 Indiana Department of Transportation \n",
- "54 5R02-50305 5R02-044 Indiana Department of Transportation \n",
- "68 5R02-50307 5R02-037 Indiana Department of Transportation \n",
- "94 5R02-50308 5R02-020 Indiana Department of Transportation \n",
- "10 5R02-50324 5R02-026 Indiana Department of Transportation \n",
- "37 5R02-50330 5R02-041 Indiana Department of Transportation \n",
- "41 5R02-50347 5R02-031 Indiana Department of Transportation \n",
- "82 5R02-50361 5R02-010 Indiana Department of Transportation \n",
- "11 5R02-50365 5R02-017 Indiana Department of Transportation \n",
- "76 5R02-50387 5R02-038 Indiana Department of Transportation \n",
- "26 5R02-50389 5R02-019 Indiana Department of Transportation \n",
- "59 5R02-50392 5R02-024 Indiana Department of Transportation \n",
- "0 5R02-50399 5R02-004 Indiana Department of Transportation \n",
- "42 5R02-50403 5R02-029 Indiana Department of Transportation \n",
- "15 5R02-50422 5R02-021 Indiana Department of Transportation \n",
- "38 5R02-50441 5R02-030 Indiana Department of Transportation \n",
- "74 5R02-50444 5R02-028 Indiana Department of Transportation \n",
- "7 5R02-50454 5R02-023 Indiana Department of Transportation \n",
- "84 5R02-50468 5R02-039 Indiana Department of Transportation \n",
- "87 5R02-50483 5R02-005 Indiana Department of Transportation \n",
- "60 5R02-50484 5R02-006 Indiana Department of Transportation \n",
- "47 5R02-50499 5R02-003 Indiana Department of Transportation \n",
- "77 60127 6127 NaN \n",
- "4 6R04-60191 6R04-002 Oklahoma Department of Transportation \n",
- "43 A0025-66344 NaN North Central Texas Council of Governments \n",
- "29 7R03-77086 NaN Missouri Department of Transportation \n",
- "27 8R01-80118 8R01-036 Colorado Department of Transportation \n",
- "64 8R05-80127 8R05-046 Wyoming Department of Transportation \n",
+ " ntd_id_2022 reported_by_name legacy_ntd_id \\\n",
+ "1 11239 NaN NaN \n",
+ "2 21 NaN 21 \n",
+ "6 30010 NaN 3010 \n",
+ "7 30041 NaN 3041 \n",
+ "8 30201 NaN NaN \n",
+ ".. ... ... ... \n",
+ "47 NaN Arizona Department of Transportation NaN \n",
+ "48 NaN Utah Department of Transportation NaN \n",
+ "49 NaN Arizona Department of Transportation NaN \n",
+ "50 NaN Arizona Department of Transportation NaN \n",
+ "51 NaN West Virginia Department of Transportation NaN \n",
"\n",
- " agency_name_x city_x \\\n",
- "61 Bay State Cruise Company NaN \n",
- "56 Baltimore County Department of Aging Baltimore \n",
- "24 Puerto Rico Highway and Transportation Authori... San Juan \n",
- "30 Municipality of Anasco Anasco \n",
- "63 Coweta County Newnan \n",
- "2 CENTRAL MISSISSIPPI INC Winona \n",
- "40 Enterprise Rideshare - Michigan Farmington Hills \n",
- "101 Boone County Commissioners Lebanon \n",
- "25 Marshall County Commissioners Plymouth \n",
- "49 Steuben County Commissioners Angola \n",
- "96 Southern Indiana Development Commission Loogootee \n",
- "52 Rush County Commissioners Rushville \n",
- "75 Cass County Commissioners Logansport \n",
- "14 Kosciusko County Commissioners Warsaw \n",
- "54 LaGrange County Commissioners Lagrange \n",
- "68 Jay County Commissioners Yorktown \n",
- "94 Monroe County Commissioners Ellettsville \n",
- "10 Historic Hoosier Hills Dillsboro \n",
- "37 DeKalb County Commissioners Auburn \n",
- "41 Harrison County Commissioners Georgetown \n",
- "82 Huntington County Commissioners Huntington \n",
- "11 Tippecanoe County Commissioners Lafayette \n",
- "76 Union County Commissioners Liberty \n",
- "26 Orange County Commissioners Paoli \n",
- "59 Knox County Commissioners Vincennes \n",
- "0 Fayette Community Commissioners Connersville \n",
- "42 Wells County Commissioners Bluffton \n",
- "15 Noble County Commissioners Albion \n",
- "38 Wabash County Commissioners Wabash \n",
- "74 White County Commissioners Monticello \n",
- "7 Miami County Commissioners Peru \n",
- "84 Whitley County Commissioners Columbia City \n",
- "87 Franklin County Commissioners Brookville \n",
- "60 Fulton County Commissioners Rochester \n",
- "47 Clinton County Commissioners Frankfort \n",
- "77 Plaquemines Parish Government Belle Chasse \n",
- "4 Little Dixie Community Action Agency, Inc. Hugo \n",
- "43 Northeast Transportation Services Fort Worth \n",
- "29 NEW BOURBON REGIONAL PORT AUTH Perryville \n",
- "27 Wet Mountain Valley Rotary Community Service Inc. Westcliffe \n",
- "64 Shoshoni Senior Citizens NaN \n",
+ " agency_name city \\\n",
+ "1 Hyannis Harbor Tours, Inc. Hyannis \n",
+ "2 Whatcom Transportation Authority Bellingham \n",
+ "6 Lehigh and Northampton Transportation Authority Allentown \n",
+ "7 Board of Commissioners of Allegany County Mary... Cumberland \n",
+ "8 City of Baltimore Baltimore \n",
+ ".. ... ... \n",
+ "47 New Horizons Disability Empowerment Center Prescott Valley \n",
+ "48 Kane County Senior Citizens Improvement Corp Kanab \n",
+ "49 Saguaro Foundation Community Living Programs Yuma \n",
+ "50 Town of springerville AZ Springerville \n",
+ "51 Greenbrier Co. Committee on Aging, Inc. Rupert \n",
"\n",
- " key_x year_x ntd_id_no_prefix ntd_id_y \\\n",
- "61 3e52a7c9c6b2b668f3f8d8aaf7407bb1 2021.0 11238 11238 \n",
- "56 a78720414cc2f8110bc995522b13af5f 2021.0 30130 30130 \n",
- "24 15dfe7c9516dd80cfcbd7e44894c3cd0 2021.0 40105 40105 \n",
- "30 727e463669495f24983f88e0c1ebc84e 2021.0 40269 40269 \n",
- "63 a2b14dc5773bf3c0ad04dfe1757d3be6 2021.0 41133 41133 \n",
- "2 a526f2abfd1780150ba2b794124d7343 2021.0 44979 44979 \n",
- "40 fb118835888478e280646363880222b4 2021.0 50193 50193 \n",
- "101 75778eabc386b8eafba4c9ecdba3400e 2021.0 50230 50230 \n",
- "25 77570092c7163f61fcf99dd2fbaa8d16 2021.0 50246 50246 \n",
- "49 09864a8b4fdbf162b3d9a0434a63efa9 2021.0 50248 50248 \n",
- "96 075d2df66f3c9d3f4b306cec2d8ecf88 2021.0 50276 50276 \n",
- "52 3e35f464fafa37874c5479eba6a8de39 2021.0 50280 50280 \n",
- "75 10cea1f86819cd03704ddad23d6ed6b2 2021.0 50281 50281 \n",
- "14 7d5e5c112a450de2882acc863ffbf347 2021.0 50289 50289 \n",
- "54 46e1f9e708e4bdc8dfc3b8b11b12c58f 2021.0 50305 50305 \n",
- "68 e62a7d09f50c6891a7f7b49711ceded0 2021.0 50307 50307 \n",
- "94 74f575bf059841b71a869fd3efd66f4f 2021.0 50308 50308 \n",
- "10 e6710aa2c700355db16170c3b148a71d 2021.0 50324 50324 \n",
- "37 ea5f5035fe8120cb93533e55883674df 2021.0 50330 50330 \n",
- "41 8af031820471773675f7d78ef0ffbb04 2021.0 50347 50347 \n",
- "82 3f28a1bf0e4b0718de390209ebd536bb 2021.0 50361 50361 \n",
- "11 8cff92c1747d39b61233f3134a9b2f50 2021.0 50365 50365 \n",
- "76 c3620a86511824ab2f1dbc6041261419 2021.0 50387 50387 \n",
- "26 68cce0722e9a67b873de8d28850aa9aa 2021.0 50389 50389 \n",
- "59 33a64f3c79c604d28a89374170b0700a 2021.0 50392 50392 \n",
- "0 eeae713c46c405e3c8d4f001df04ab08 2021.0 50399 50399 \n",
- "42 0959996691b94d855104db0d33b2e1c1 2021.0 50403 50403 \n",
- "15 019f5b9e0cc9b402ee30dfbc52e70889 2021.0 50422 50422 \n",
- "38 95e83cbe96f8b149cf091a688e4efd7e 2021.0 50441 50441 \n",
- "74 3e9bd5cfa85e2e200430e73cd794e4eb 2021.0 50444 50444 \n",
- "7 e0b549ebd3208c1adf7e8daff9b02e56 2021.0 50454 50454 \n",
- "84 518ace07cb87072ec541dc7fef24e6f7 2021.0 50468 50468 \n",
- "87 588365cb83b4b249b502b797bf217299 2021.0 50483 50483 \n",
- "60 c15d9675ebd9e79a1e9b21ce171c907c 2021.0 50484 50484 \n",
- "47 ae316730728efa5b437e71f8a123e510 2021.0 50499 50499 \n",
- "77 507c162cbce391ef4ac5db7e7e420b0d 2021.0 60127 60127 \n",
- "4 e60a5ce844c6fc0427a182ccb89190a4 2021.0 60191 60191 \n",
- "43 6078b40173c8a29881a4e217181547d6 2021.0 66344 66344 \n",
- "29 76f5a9389da3eb3cf3060057c880c3f6 2021.0 77086 77086 \n",
- "27 64c2d7f92534e463125d4f208bf04f04 2021.0 80118 80118 \n",
- "64 783e80db49b656ed4e4eb77c4c25e974 2021.0 80127 80127 \n",
+ " ntd_id_2021 Remarks ntd_id_2022 Remarks \n",
+ "1 11239 NaN NaN NaN \n",
+ "2 21 NaN NaN NaN \n",
+ "6 30010 NaN NaN NaN \n",
+ "7 30041 NaN NaN NaN \n",
+ "8 30201 NaN NaN NaN \n",
+ ".. ... ... ... ... \n",
+ "47 NaN NaN 99463.0 NaN \n",
+ "48 NaN NaN 88253.0 NaN \n",
+ "49 NaN NaN 99462.0 NaN \n",
+ "50 NaN NaN 99467.0 NaN \n",
+ "51 NaN NaN 31048.0 NaN \n",
"\n",
- " reported_by_name_y \\\n",
- "61 NaN \n",
- "56 Maryland Department of Transportation \n",
- "24 NaN \n",
- "30 NaN \n",
- "63 NaN \n",
- "2 Mississippi Department of Transportation \n",
- "40 NaN \n",
- "101 Indiana Department of Transportation \n",
- "25 Indiana Department of Transportation \n",
- "49 Indiana Department of Transportation \n",
- "96 Indiana Department of Transportation \n",
- "52 Indiana Department of Transportation \n",
- "75 Indiana Department of Transportation \n",
- "14 Indiana Department of Transportation \n",
- "54 Indiana Department of Transportation \n",
- "68 Indiana Department of Transportation \n",
- "94 Indiana Department of Transportation \n",
- "10 Indiana Department of Transportation \n",
- "37 Indiana Department of Transportation \n",
- "41 Indiana Department of Transportation \n",
- "82 Indiana Department of Transportation \n",
- "11 Indiana Department of Transportation \n",
- "76 Indiana Department of Transportation \n",
- "26 Indiana Department of Transportation \n",
- "59 Indiana Department of Transportation \n",
- "0 Indiana Department of Transportation \n",
- "42 Indiana Department of Transportation \n",
- "15 Indiana Department of Transportation \n",
- "38 Indiana Department of Transportation \n",
- "74 Indiana Department of Transportation \n",
- "7 Indiana Department of Transportation \n",
- "84 Indiana Department of Transportation \n",
- "87 Indiana Department of Transportation \n",
- "60 Indiana Department of Transportation \n",
- "47 Indiana Department of Transportation \n",
- "77 Louisiana Department of Transportation \n",
- "4 Oklahoma Department of Transportation \n",
- "43 NaN \n",
- "29 Missouri Department of Transportation \n",
- "27 Colorado Department of Transportation \n",
- "64 Wyoming Department of Transportation \n",
- "\n",
- " agency_name_y city_y \\\n",
- "61 Bay State LLC Boston \n",
- "56 Baltimore County Department of Public Works Tr... Towson \n",
- "24 Puerto Rico Highway and Transportation Authori... San Juan \n",
- "30 Municipality of Añasco Anasco \n",
- "63 Coweta County Newnan \n",
- "2 Central Mississippi, Incorporated Winona \n",
- "40 Michigan Department of Transportation NaN \n",
- "101 Boone County Senior Services Lebanon \n",
- "25 Marshall County Council on Aging Plymouth \n",
- "49 Steuben County Council on Aging Angola \n",
- "96 Four Rivers Resource Services Loogootee \n",
- "52 Rush County Senior Services Rushville \n",
- "75 Cass County Council on Aging Logansport \n",
- "14 Cardinal Services Warsaw \n",
- "54 LaGrange County Council on Aging Lagrange \n",
- "68 LifeStream Services Yorktown \n",
- "94 Area 10 Council on Aging of Monroe County Ellettsville \n",
- "10 LifeTime Resources Dillsboro \n",
- "37 DeKalb County Council on Aging Auburn \n",
- "41 Blue River Services Corydon \n",
- "82 Huntington County Council on Aging Huntington \n",
- "11 Area IV Agency on Aging and Community Action P... Lafayette \n",
- "76 Union County Council on Aging Liberty \n",
- "26 Orange County First Chance Center Paoli \n",
- "59 YMCA of Vincennes Vincennes \n",
- "0 Fayette County Council Agency on Aging and Aged Connersville \n",
- "42 Wells County Council on Aging Bluffton \n",
- "15 Noble County Council on Aging Albion \n",
- "38 Living Wells in Wabash County Council on Aging Wabash \n",
- "74 White County Council on Aging Monticello \n",
- "7 Miami County YMCA Peru \n",
- "84 Whitley County Council on Aging Columbia City \n",
- "87 Franklin County Senior Services Brookville \n",
- "60 Fulton County Council on Aging Rochester \n",
- "47 Paul Philippe Resource Center Frankfort \n",
- "77 Plaquemines Parish Government Belle Chasse \n",
- "4 LIFT COMMUNITY ACTION AGENCY INC LIFT Hugo \n",
- "43 Northeast Transportation Services Fort Worth \n",
- "29 New Bourbon Regional Port Authority Perryville \n",
- "27 Wet Mountain Valley Rotary Community Service, ... Westcliffe \n",
- "64 Shoshoni Senior Citizens Center Shoshoni \n",
- "\n",
- " key_y year_y _merge \n",
- "61 0d5ba39814c8d079274b8a9f0cc57094 2022.0 both \n",
- "56 82625c40cb5f233003bd99bf662c0f8c 2022.0 both \n",
- "24 671fb05927de6f93c0b7fbc231ba0c3f 2022.0 both \n",
- "30 bf314c9d218b6b33879aca0e15a0aec6 2022.0 both \n",
- "63 dd0a411799e522f52608bb1977d5a149 2022.0 both \n",
- "2 b1c19267d796b92f9da7b0491ac539e7 2022.0 both \n",
- "40 5db618a2d5318c4dff590a53f339688a 2022.0 both \n",
- "101 51057c0cb82672b5f5c59afd1e9217ef 2022.0 both \n",
- "25 67f53fd56b632e5a1edbcbc9beb819cb 2022.0 both \n",
- "49 68c0951ae10e643259fbad16a68b0501 2022.0 both \n",
- "96 e8c4337e4072dcff70836d5aa72d6d0e 2022.0 both \n",
- "52 d3ffb9b7a07a22227815c8c850384777 2022.0 both \n",
- "75 021a9930cc37edb3d2b04e0f47c0518f 2022.0 both \n",
- "14 4e91b967ea275a6f3bd9d748e0755299 2022.0 both \n",
- "54 06013a9919f57f65e7e19604d97fd876 2022.0 both \n",
- "68 24ad33959cbe7492784bed1b19148448 2022.0 both \n",
- "94 00d4f9e499a70f66a8a72c0f4c42d408 2022.0 both \n",
- "10 8b9f8b88b29442184defa14305fd5cbf 2022.0 both \n",
- "37 f86b7873b1bf7f66462e1126e2e6cba8 2022.0 both \n",
- "41 5c6ef7763f8d3c56e2116e821a31f869 2022.0 both \n",
- "82 edbf0f943976f37a77cff85b99004094 2022.0 both \n",
- "11 a561a8b8df6a37f2dd4f141e4902d346 2022.0 both \n",
- "76 e5314f96a7b7c1c48612fa62b2f88a7c 2022.0 both \n",
- "26 7ac967575d36aa7c14596cfd5dc679c7 2022.0 both \n",
- "59 13d170d217ad0cf7860e62ce13651004 2022.0 both \n",
- "0 4e3cd53439c5b16a8db255353ab5f452 2022.0 both \n",
- "42 0686e12cdf0e5053047e63ff96e7c83b 2022.0 both \n",
- "15 5ef553988ed5ffe7abf562f9700c5e68 2022.0 both \n",
- "38 2547e2ebe22ddcb01ae9adedd3d38a4b 2022.0 both \n",
- "74 91d0c6fd3810f8971287135ca843990d 2022.0 both \n",
- "7 8a1db7fdef4bd99effcad121ce960a7a 2022.0 both \n",
- "84 0b058ae9f5d5a1e9780257c981a6b91c 2022.0 both \n",
- "87 b76b01f10dcbcd6616d05ff50d86b353 2022.0 both \n",
- "60 938d6b2a2c0297e4b2d77ddece412a5d 2022.0 both \n",
- "47 0ea094bd3b3b713d00eb383fec67b849 2022.0 both \n",
- "77 68bcb32f91c2e25018dfff92f2f3739a 2022.0 both \n",
- "4 3bfbdeaa0429bd8cd0fddc2f59892661 2022.0 both \n",
- "43 d7f9a702076e56039e38b4deb3798b49 2022.0 both \n",
- "29 66ac0917e90aea3a1df01b4303967ec3 2022.0 both \n",
- "27 a2a83e9259a69aec792f7b67e3292d06 2022.0 both \n",
- "64 a3674c39d8e7ff4026b491956dc20193 2022.0 both "
+ "[3012 rows x 9 columns]"
]
},
- "execution_count": 16,
+ "execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "m3[m3._merge==\"both\"].sort_values(\"ntd_id_no_prefix\")"
+ "final_crosswalk"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "id": "dcb4a61d-d7f2-49f2-98f9-04bb1260b2c7",
+ "metadata": {
+ "tags": []
+ },
+ "outputs": [],
+ "source": [
+ "final_crosswalk.to_csv(f\"{GCS_PATH}final_crosswalk.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
- "id": "92906541-2a8f-46aa-aae0-7bc60d892fe1",
+ "id": "2470aac7-5f05-4f9a-a988-8bcca4e53d80",
"metadata": {},
"outputs": [],
"source": []