diff --git a/ntd/1943_revenue_vehicle_count.ipynb b/ntd/1943_revenue_vehicle_count.ipynb new file mode 100644 index 000000000..f653d4099 --- /dev/null +++ b/ntd/1943_revenue_vehicle_count.ipynb @@ -0,0 +1,902 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "d0195f30-5162-41ef-ae39-83cb6d51e741", + "metadata": {}, + "outputs": [], + "source": [ + "from functools import cache\n", + "from calitp_data_analysis.gcs_pandas import GCSPandas\n", + "\n", + "@cache\n", + "def gcs_pandas():\n", + " return GCSPandas()\n", + "\n", + "import pandas as pd\n", + "pd.set_option(\"display.max_columns\", None)\n", + "pd.set_option(\"display.max_rows\", None)" + ] + }, + { + "cell_type": "markdown", + "id": "b8b9cb8f-d3da-454c-9cde-a2f3c47ae133", + "metadata": {}, + "source": [ + "# Get NTD ID from warehouse\n", + "for all California agences in NTD" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a7ec737b-3f8e-44ac-a3fd-bd52be39d33a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 209 entries, 0 to 208\n", + "Data columns (total 3 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 ntd_id_mart 209 non-null object \n", + " 1 agency_mart 209 non-null object \n", + " 2 agency_voms_mart 209 non-null float64\n", + "dtypes: float64(1), object(2)\n", + "memory usage: 5.0+ KB\n" + ] + } + ], + "source": [ + "# need to get ntd ID of all California agencies\n", + "from calitp_data_analysis.sql import query_sql\n", + "\n", + "# also include VOMs for comparison\n", + "ca_agencies = query_sql(\n", + " \"\"\"\n", + " SELECT distinct \n", + " ntd_id, \n", + " agency, \n", + " agency_voms\n", + " FROM cal-itp-data-infra.mart_ntd.dim_annual_service_agencies\n", + " WHERE \n", + " state = 'CA' \n", + " AND report_year = 2024\n", + " \"\"\",\n", + " as_df=True,\n", + ")\n", + "ca_agencies = ca_agencies.add_suffix(\"_mart\")\n", + "ca_agencies.info()" + ] + }, + { + "cell_type": "markdown", + "id": "0256b927-d5d9-4d30-a56e-9c044294a48d", + "metadata": {}, + "source": [ + "# Read in NTD 2024 Revenue Vehicle Inventory\n", + "this list all the revenue vehicles reported by each agency" + ] + }, + { + "cell_type": "markdown", + "id": "9fd32f55-5924-4188-8912-7e8df421f821", + "metadata": {}, + "source": [ + "## NTD Glossary Definitions\n", + "- `Active Vehicles`\n", + "> The vehicles available to operate in revenue service at the end of the fiscal year, including: \n", + "• Spares\n", + "• Vehicles temporarily out of service for routine maintenance and minor repairs\n", + "• Operational vehicles\n", + "\n", + "- Active Vehicles in Fleet\n", + ">The vehicles in a particular fleet at year-end that are available to operate in revenue service, including: \n", + "• Spares\n", + "• Vehicles temporarily out of service for routine maintenance and minor repairs\n", + "\n", + "- Number of Active Vehicles in Fleet\n", + ">The total number of operational revenue vehicles in the fleet available for general public transit service, including spare or back up revenue vehicles. The total should also include any operational revenue vehicles used by contractors in general public transit service. Non-revenue service vehicles and personal vehicles should not be included. Can be found in: A-30\n", + "\n", + "- `Vehicles in Total Fleet`\n", + ">All revenue vehicles held at the end of the fiscal year, including those: \n", + "• In service;\n", + "• In storage;\n", + "• Emergency contingency; and\n", + "• Awaiting sale.\n", + "Can be found in: A-30\n", + "\n", + "- `Vehicles Operated in Annual Maximum Service (VOMS)`\n", + ">The number of revenue vehicles operated to meet the annual maximum service requirement. This is the revenue vehicle count during the peak season of the year; on the week and day that maximum service is provided. Vehicles operated in maximum service (VOMS) exclude: \n", + "• Atypical days; or\n", + "• One-time special events.\n", + "Can be found in: B-30, A-30, S-10, Declarations, MR-20" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "dda723ab-ddf2-47a7-94cf-c31a93722916", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 35218 entries, 0 to 35217\n", + "Data columns (total 41 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 state/parent_ntd_id 13899 non-null object \n", + " 1 ntd_id 35218 non-null object \n", + " 2 agency_name 35218 non-null object \n", + " 3 reporter_type 35218 non-null object \n", + " 4 reporting_module 35218 non-null object \n", + " 5 group_plan_sponsor_ntdid 18739 non-null object \n", + " 6 group_plan_sponsor_name 18739 non-null object \n", + " 7 modes 35218 non-null object \n", + " 8 revenue_vehicle_inventory_id 35218 non-null int64 \n", + " 9 agency_fleet_id 35218 non-null object \n", + " 10 modetos_vehicles_operated_in_maximum_service 32583 non-null float64\n", + " 11 total_fleet_vehicles 35218 non-null int64 \n", + " 12 dedicated_fleet 35218 non-null object \n", + " 13 vehicle_type 35218 non-null object \n", + " 14 ownership_type 35218 non-null object \n", + " 15 funding_source 35218 non-null object \n", + " 16 manufacture_year 33589 non-null float64\n", + " 17 rebuild_year 1651 non-null float64\n", + " 18 type_of_last_renewal 1754 non-null object \n", + " 19 useful_life_benchmark 31097 non-null float64\n", + " 20 manufacturer 18955 non-null object \n", + " 21 other_manufacturer_description 360 non-null object \n", + " 22 model 18934 non-null object \n", + " 23 active_fleet_vehicles 35218 non-null int64 \n", + " 24 ada_fleet_vehicles 30198 non-null float64\n", + " 25 emergency_contingency_vehicles 6967 non-null float64\n", + " 26 fuel_type 34135 non-null object \n", + " 27 other_fuel_description 55 non-null object \n", + " 28 vehicle_length 33589 non-null float64\n", + " 29 seating_capacity 35218 non-null int64 \n", + " 30 standing_capacity 18939 non-null float64\n", + " 31 total_miles_on_active_vehicles_during_period 18552 non-null float64\n", + " 32 average_lifetime_miles_per_active_vehicles 18552 non-null float64\n", + " 33 no_capital_replacement_flag 2492 non-null object \n", + " 34 separate_asset_flag 35218 non-null object \n", + " 35 event_data_recorders 2287 non-null float64\n", + " 36 emergency_lighting_system_design 2287 non-null float64\n", + " 37 emergency_signage 2287 non-null float64\n", + " 38 emergency_path_marking 2287 non-null float64\n", + " 39 automated_vehicles_flag 55 non-null object \n", + " 40 notes 9119 non-null object \n", + "dtypes: float64(14), int64(4), object(23)\n", + "memory usage: 11.0+ MB\n" + ] + } + ], + "source": [ + "# saved excel to GCS, so use gcs_pandas()\n", + "this_gcs_path = \"gs://calitp-analytics-data/data-analyses/ntd/\"\n", + "rev_veh_inv_link = f\"{this_gcs_path}2024 Revenue Vehicle Inventory_250820.xlsx\"\n", + "\n", + "rev_veh = gcs_pandas().read_excel(rev_veh_inv_link)\n", + "\n", + "rev_veh.columns = rev_veh.columns.str.lower().str.strip().str.replace(\" \",\"_\")\n", + "rev_veh[\"ntd_id\"] = rev_veh[\"ntd_id\"].astype(\"str\")\n", + "rev_veh.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "9b75abc8-a7b2-4bf0-a1f7-e1d72f86638c", + "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", + "
state/parent_ntd_idntd_idagency_namereporter_typereporting_modulegroup_plan_sponsor_ntdidgroup_plan_sponsor_namemodesrevenue_vehicle_inventory_idagency_fleet_idmodetos_vehicles_operated_in_maximum_servicetotal_fleet_vehiclesdedicated_fleetvehicle_typeownership_typefunding_sourcemanufacture_yearrebuild_yeartype_of_last_renewaluseful_life_benchmarkmanufacturerother_manufacturer_descriptionmodelactive_fleet_vehiclesada_fleet_vehiclesemergency_contingency_vehiclesfuel_typeother_fuel_descriptionvehicle_lengthseating_capacitystanding_capacitytotal_miles_on_active_vehicles_during_periodaverage_lifetime_miles_per_active_vehiclesno_capital_replacement_flagseparate_asset_flagevent_data_recordersemergency_lighting_system_designemergency_signageemergency_path_markingautomated_vehicles_flagnotes
0NaN1King CountyFull ReporterUrbanNaNNaNDR/PT37760366.02YCutawayOwned outright by public agency (OOPA)Non-Federal Public Funds (NFPA)2009.0NaNNaN10.0Startrans (Supreme Corporation)NaNSupremeSenator00.00.0Diesel FuelNaN22.0130.0NaNNaNNaNNNaNNaNNaNNaNNaNNaN
1NaN1King CountyFull ReporterUrbanNaNNaNDR/PT42645366.014YCutawayOwned outright by public agency (OOPA)Non-Federal Public Funds (NFPA)2010.0NaNNaN10.0Startrans (Supreme Corporation)NaNSupremeSenator1414.00.0Diesel FuelNaN22.0130.066135.0302864.0NaNNNaNNaNNaNNaNNaNNaN
2NaN1King CountyFull ReporterUrbanNaNNaNDR/PT48057366.08YCutawayOwned outright by public agency (OOPA)Non-Federal Public Funds (NFPA)2011.0NaNNaN10.0Startrans (Supreme Corporation)NaNSupremeSenator88.00.0GasolineNaN22.0130.080753.0220649.0NaNNNaNNaNNaNNaNNaNNaN
\n", + "
" + ], + "text/plain": [ + " state/parent_ntd_id ntd_id agency_name reporter_type reporting_module \\\n", + "0 NaN 1 King County Full Reporter Urban \n", + "1 NaN 1 King County Full Reporter Urban \n", + "2 NaN 1 King County Full Reporter Urban \n", + "\n", + " group_plan_sponsor_ntdid group_plan_sponsor_name modes \\\n", + "0 NaN NaN DR/PT \n", + "1 NaN NaN DR/PT \n", + "2 NaN NaN DR/PT \n", + "\n", + " revenue_vehicle_inventory_id agency_fleet_id \\\n", + "0 37760 \n", + "1 42645 \n", + "2 48057 \n", + "\n", + " modetos_vehicles_operated_in_maximum_service total_fleet_vehicles \\\n", + "0 366.0 2 \n", + "1 366.0 14 \n", + "2 366.0 8 \n", + "\n", + " dedicated_fleet vehicle_type ownership_type \\\n", + "0 Y Cutaway Owned outright by public agency (OOPA) \n", + "1 Y Cutaway Owned outright by public agency (OOPA) \n", + "2 Y Cutaway Owned outright by public agency (OOPA) \n", + "\n", + " funding_source manufacture_year rebuild_year \\\n", + "0 Non-Federal Public Funds (NFPA) 2009.0 NaN \n", + "1 Non-Federal Public Funds (NFPA) 2010.0 NaN \n", + "2 Non-Federal Public Funds (NFPA) 2011.0 NaN \n", + "\n", + " type_of_last_renewal useful_life_benchmark \\\n", + "0 NaN 10.0 \n", + "1 NaN 10.0 \n", + "2 NaN 10.0 \n", + "\n", + " manufacturer other_manufacturer_description \\\n", + "0 Startrans (Supreme Corporation) NaN \n", + "1 Startrans (Supreme Corporation) NaN \n", + "2 Startrans (Supreme Corporation) NaN \n", + "\n", + " model active_fleet_vehicles ada_fleet_vehicles \\\n", + "0 SupremeSenator 0 0.0 \n", + "1 SupremeSenator 14 14.0 \n", + "2 SupremeSenator 8 8.0 \n", + "\n", + " emergency_contingency_vehicles fuel_type other_fuel_description \\\n", + "0 0.0 Diesel Fuel NaN \n", + "1 0.0 Diesel Fuel NaN \n", + "2 0.0 Gasoline NaN \n", + "\n", + " vehicle_length seating_capacity standing_capacity \\\n", + "0 22.0 13 0.0 \n", + "1 22.0 13 0.0 \n", + "2 22.0 13 0.0 \n", + "\n", + " total_miles_on_active_vehicles_during_period \\\n", + "0 NaN \n", + "1 66135.0 \n", + "2 80753.0 \n", + "\n", + " average_lifetime_miles_per_active_vehicles no_capital_replacement_flag \\\n", + "0 NaN NaN \n", + "1 302864.0 NaN \n", + "2 220649.0 NaN \n", + "\n", + " separate_asset_flag event_data_recorders emergency_lighting_system_design \\\n", + "0 N NaN NaN \n", + "1 N NaN NaN \n", + "2 N NaN NaN \n", + "\n", + " emergency_signage emergency_path_marking automated_vehicles_flag notes \n", + "0 NaN NaN NaN NaN \n", + "1 NaN NaN NaN NaN \n", + "2 NaN NaN NaN NaN " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rev_veh.head(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "6d88cd1f-f355-48d1-ab15-08d6b10be270", + "metadata": {}, + "outputs": [], + "source": [ + "# filter the NTD list by the NTD id from the warehouse\n", + "\n", + "ca_rev_veh = rev_veh[rev_veh[\"ntd_id\"].isin(\n", + " ca_agencies[\"ntd_id_mart\"].unique().tolist()\n", + ")]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "989719de-2471-4aa9-a4fc-928222af13e1", + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "# group by / aggregate by active fleet, total fleet, VOMS. \n", + "# maybe there is a difference between all of the. I expect the toal fleet to be the highest\n", + "\n", + "ca_rev_veh = ca_rev_veh.groupby(\n", + " [\n", + " \"ntd_id\",\n", + " \"agency_name\",\n", + " ]\n", + ").agg({\n", + " \"total_fleet_vehicles\": \"sum\",\n", + " \"active_fleet_vehicles\":\"sum\",\n", + " \"modetos_vehicles_operated_in_maximum_service\":\"max\"\n", + "}).reset_index()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "b5b819ad-5872-4e7c-9b8d-2437d0e3a87d", + "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", + "
ntd_idagency_nametotal_fleet_vehiclesactive_fleet_vehiclesmodetos_vehicles_operated_in_maximum_service
090003San Francisco Bay Area Rapid Transit District785776566.0
190004Golden Empire Transit District16016051.0
290006Santa Cruz Metropolitan Transit District14714758.0
390008City of Santa Monica239239124.0
490009San Mateo County Transit District468468178.0
\n", + "
" + ], + "text/plain": [ + " ntd_id agency_name total_fleet_vehicles \\\n", + "0 90003 San Francisco Bay Area Rapid Transit District 785 \n", + "1 90004 Golden Empire Transit District 160 \n", + "2 90006 Santa Cruz Metropolitan Transit District 147 \n", + "3 90008 City of Santa Monica 239 \n", + "4 90009 San Mateo County Transit District 468 \n", + "\n", + " active_fleet_vehicles modetos_vehicles_operated_in_maximum_service \n", + "0 776 566.0 \n", + "1 160 51.0 \n", + "2 147 58.0 \n", + "3 239 124.0 \n", + "4 468 178.0 " + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ca_rev_veh.head()" + ] + }, + { + "cell_type": "markdown", + "id": "1906b9b3-b731-4d96-a5a4-b7c8ad8f9f87", + "metadata": {}, + "source": [ + "## difference between VOMs and Rev Vehicle Inv." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "af546470-b091-4187-a64f-2a46c02132d5", + "metadata": {}, + "outputs": [], + "source": [ + "diff_voms_ref_veh = ca_rev_veh.merge(\n", + " ca_agencies,\n", + " left_on=\"ntd_id\",\n", + " right_on=\"ntd_id_mart\",\n", + " how=\"inner\",\n", + " # suffixes = (\"_ntd_excel\",\"_warehouse\"),\n", + " # indicator=True # dont really need this since how=inner\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "2403e7dd-6cbf-47da-9cf3-847108e731b7", + "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", + "
ntd_idagency_nametotal_fleet_vehiclesactive_fleet_vehiclesmodetos_vehicles_operated_in_maximum_servicentd_id_martagency_martagency_voms_mart
090003San Francisco Bay Area Rapid Transit District785776566.090003San Francisco Bay Area Rapid Transit District,...582.0
190004Golden Empire Transit District16016051.090004Golden Empire Transit District93.0
290006Santa Cruz Metropolitan Transit District14714758.090006Santa Cruz Metropolitan Transit District97.0
390008City of Santa Monica239239124.090008City of Santa Monica, dba: Big Blue Bus162.0
490009San Mateo County Transit District468468178.090009San Mateo County Transit District, dba: SamTrans361.0
\n", + "
" + ], + "text/plain": [ + " ntd_id agency_name total_fleet_vehicles \\\n", + "0 90003 San Francisco Bay Area Rapid Transit District 785 \n", + "1 90004 Golden Empire Transit District 160 \n", + "2 90006 Santa Cruz Metropolitan Transit District 147 \n", + "3 90008 City of Santa Monica 239 \n", + "4 90009 San Mateo County Transit District 468 \n", + "\n", + " active_fleet_vehicles modetos_vehicles_operated_in_maximum_service \\\n", + "0 776 566.0 \n", + "1 160 51.0 \n", + "2 147 58.0 \n", + "3 239 124.0 \n", + "4 468 178.0 \n", + "\n", + " ntd_id_mart agency_mart \\\n", + "0 90003 San Francisco Bay Area Rapid Transit District,... \n", + "1 90004 Golden Empire Transit District \n", + "2 90006 Santa Cruz Metropolitan Transit District \n", + "3 90008 City of Santa Monica, dba: Big Blue Bus \n", + "4 90009 San Mateo County Transit District, dba: SamTrans \n", + "\n", + " agency_voms_mart \n", + "0 582.0 \n", + "1 93.0 \n", + "2 97.0 \n", + "3 162.0 \n", + "4 361.0 " + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "diff_voms_ref_veh.head()" + ] + }, + { + "cell_type": "markdown", + "id": "b084f861-b850-4876-8a15-0a8e54f6b6d5", + "metadata": {}, + "source": [ + "## Calculate the differencs in VOMS values between the revenue vehicle inventory and the warehouse\n", + "Note, the warehouse table pull from a NTD excel file as well, so VOMS should be the same..." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "f732a8a3-beef-4949-97cc-2dcb08e89435", + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "diff_voms_ref_veh[\"voms_diff\"] = diff_voms_ref_veh[\"agency_voms_mart\"] - diff_voms_ref_veh[\"modetos_vehicles_operated_in_maximum_service\"] " + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "c297f793-c6c2-4524-bd3d-a90c6b7da5d8", + "metadata": {}, + "outputs": [], + "source": [ + "diff_voms_ref_veh[\"total_fleet_veh_voms_diff\"] = diff_voms_ref_veh[\"total_fleet_vehicles\"] - diff_voms_ref_veh[\"modetos_vehicles_operated_in_maximum_service\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "464bf7c1-d39d-4218-a239-8e42649f375a", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "209" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "diff_voms_ref_veh[\"ntd_id\"].nunique()" + ] + }, + { + "cell_type": "markdown", + "id": "7545e6b3-1482-457b-ae07-804d8d2cf938", + "metadata": {}, + "source": [ + "## save data to GCS" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "5727de43-f695-4b9b-96a5-0435e7bb4942", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "diff_voms_ref_veh.to_csv(f\"{this_gcs_path}1943_total_revenue_vehicles.csv\")" + ] + }, + { + "cell_type": "markdown", + "id": "97c23ff2-9f68-4dd1-9797-23049c37a6f2", + "metadata": {}, + "source": [ + "# Count of routes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a13e6d1d-906c-4626-88dd-1237e24bc0fa", + "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.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}