From cd10c7558cf4d6fa0c1cc72dac445e23e2f7a697 Mon Sep 17 00:00:00 2001 From: natam1 Date: Mon, 18 Mar 2024 21:22:34 +0000 Subject: [PATCH 01/16] saving progress --- .../corridor_study/data_downloads.ipynb | 4162 +++++++++++++++++ 1 file changed, 4162 insertions(+) create mode 100644 sb125_analyses/corridor_study/data_downloads.ipynb diff --git a/sb125_analyses/corridor_study/data_downloads.ipynb b/sb125_analyses/corridor_study/data_downloads.ipynb new file mode 100644 index 000000000..d903beaa5 --- /dev/null +++ b/sb125_analyses/corridor_study/data_downloads.ipynb @@ -0,0 +1,4162 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "82a53f1d-2622-4cb0-bfdd-36ceec652215", + "metadata": {}, + "source": [ + "# SB1 Big Data Downloads\n", + "An analysis into the corridor analysis data downloads from Streetlight and Replica" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "45233485-2055-499a-a89e-fc154fd56e63", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from siuba import *\n", + "\n", + "from calitp_data_analysis.sql import to_snakecase" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "651aae92-5188-4676-8e5f-3c040f77077c", + "metadata": {}, + "outputs": [], + "source": [ + "pd.set_option('display.max_columns', 500)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "af402da0-0b03-4c71-a1af-19f97f67cef1", + "metadata": {}, + "outputs": [], + "source": [ + "GCS_PATH = \"gs://calitp-analytics-data/data-analyses/sb125/corridor_study_data/\"" + ] + }, + { + "cell_type": "markdown", + "id": "71c1deda-8e83-45d8-a0f5-20b36b7051c0", + "metadata": {}, + "source": [ + "#### Read in Replica Data" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "0e5c1b44-c981-4a9a-b6ea-e1cb2a7a279e", + "metadata": {}, + "outputs": [], + "source": [ + "replica_trips = \"replica-bay_bridge-03_06_24-trips_dataset.csv\"" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "cb3dea26-4e6d-4dc7-acc8-27b899a0a537", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_156/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))\n" + ] + } + ], + "source": [ + "r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "4713b1a5-ccac-4e1b-8552-850285cad53e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
origin_building_usetrip_duration_minutestrip_taker_languageorigin_trct_2020trip_taker_household_idtrip_taker_sextrip_taker_home_bgrp_2020origin_st_2020trip_taker_home_st_2020trip_taker_race_ethnicitytransit_agencytransit_routetrip_taker_resident_typevehicle_typetrip_taker_ageactivity_iddestination_bgrp_2020destination_building_usetrip_taker_wfhdestination_st_2020destination_cty_2020trip_taker_work_bgrp_2020destination_trct_2020trip_taker_household_incomeorigin_bgrp_2020trip_taker_commute_modetrip_taker_available_vehiclesprimary_modeprevious_trip_purposetrip_taker_building_typetransit_submodetrip_taker_work_st_2020trip_taker_household_sizeorigin_cty_2020destination_land_usetrip_taker_industrytrip_taker_tenurevehicle_fuel_typetrip_taker_home_trct_2020trip_taker_work_trct_2020trip_taker_educationtrip_start_timetrip_taker_individual_incometrip_taker_employment_statustrip_purposeorigin_land_usetrip_taker_work_cty_2020trip_distance_milestrip_taker_school_grade_attendingtrip_taker_home_cty_2020trip_taker_person_idtrip_end_time
316049single_family53english327 (San Francisco, CA)9141816078114771967male7 (Tract 327, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type69.0139276359062600895851 (Tract 4287, Alameda, CA)single_familyunemployed_under_16_not_in_labor_forceCaliforniaAlamedaDoes not have work/school location4287 (Alameda, CA)0.07 (Tract 327, San Francisco, CA)other_travel_modetwoauto_passengerhomesingle_familyNaNDoes not have work/school location1.0San Franciscosingle_familynot_workingownerunknown_fuel_type327 (San Francisco, CA)Does not have work/school locationadvanced_degree05:42:000.0not_in_labor_forceworksingle_familyDoes not have work/school location24.1not_attending_schoolSan Francisco1832913191530478363506:35:44
589366multi_family29english6041.03 (San Mateo, CA)9632183769534570447female2 (Tract 6041.03, San Mateo, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type46.077058582139982136643 (Tract 4012, Alameda, CA)non_retail_attractionremoteCaliforniaAlameda3 (Tract 6024, San Mateo, CA)4012 (Alameda, CA)83424.02 (Tract 6041.03, San Mateo, CA)worked_from_homeoneauto_passengerwork_from_homemultiple_unitsNaNCalifornia1.0San Mateomixed_usenaics621492renterunknown_fuel_type6041.03 (San Mateo, CA)6024 (San Mateo, CA)some_college10:44:0083424.0employedrecreationmulti_familySan Mateo22.6not_attending_schoolSan Mateo206228327931741452211:13:30
248983single_family59english6038.02 (San Mateo, CA)11049592624520655437female1 (Tract 6038.02, San Mateo, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type51.097276669068618814782 (Tract 3580, Contra Costa, CA)retailremoteCaliforniaContra Costa1 (Tract 6038.02, San Mateo, CA)3580 (Contra Costa, CA)207015.01 (Tract 6038.02, San Mateo, CA)worked_from_homethree_plusprivate_autohomesingle_familyNaNCalifornia3.0San Mateoretailnaics62ownerother_non_bev6038.02 (San Mateo, CA)6038.02 (San Mateo, CA)some_college18:24:0085484.0employedshopsingle_familySan Mateo38.6not_attending_schoolSan Mateo448884883135888261119:23:48
18698retail31NaN110.02 (San Francisco, CA)NaNVisitor (no home location)CaliforniaVisitor (no home location)NaNNaNNaNvisitorunknown_vehicle_typeNaN69900469853168478091 (Tract 4230, Alameda, CA)retailNaNCaliforniaAlamedaVisitor (no work/school location)4230 (Alameda, CA)NaN1 (Tract 110.02, San Francisco, CA)NaNNaNauto_passengershopNaNNaNVisitor (no work/school location)NaNSan Franciscomixed_useNaNNaNunknown_fuel_typeVisitor (no home location)Visitor (no work/school location)NaN17:31:08NaNNaNeatmixed_useVisitor (no work/school location)13.1NaNVisitor (no home location)1723630108789970816518:02:42
505861non_retail_attraction45english615.07 (San Francisco, CA)1615955340221599382female1 (Tract 3521.02, Contra Costa, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type75.0882547487927688871 (Tract 3521.02, Contra Costa, CA)single_familyin_personCaliforniaContra Costa1 (Tract 615.07, San Francisco, CA)3521.02 (Contra Costa, CA)509711.01 (Tract 615.07, San Francisco, CA)auto_passengertwoauto_passengerworksingle_familyNaNCalifornia2.0San Franciscosingle_familynaics56ownerunknown_fuel_type3521.02 (Contra Costa, CA)615.07 (San Francisco, CA)some_college16:39:0012874.0employedhomenon_retail_attractionSan Francisco21.8not_attending_schoolContra Costa1426732392403104328417:24:46
\n", + "
" + ], + "text/plain": [ + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "316049 single_family 53 english \n", + "589366 multi_family 29 english \n", + "248983 single_family 59 english \n", + "18698 retail 31 NaN \n", + "505861 non_retail_attraction 45 english \n", + "\n", + " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", + "316049 327 (San Francisco, CA) 9141816078114771967 male \n", + "589366 6041.03 (San Mateo, CA) 9632183769534570447 female \n", + "248983 6038.02 (San Mateo, CA) 11049592624520655437 female \n", + "18698 110.02 (San Francisco, CA) NaN \n", + "505861 615.07 (San Francisco, CA) 1615955340221599382 female \n", + "\n", + " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", + "316049 7 (Tract 327, San Francisco, CA) California \n", + "589366 2 (Tract 6041.03, San Mateo, CA) California \n", + "248983 1 (Tract 6038.02, San Mateo, CA) California \n", + "18698 Visitor (no home location) California \n", + "505861 1 (Tract 3521.02, Contra Costa, CA) California \n", + "\n", + " trip_taker_home_st_2020 trip_taker_race_ethnicity \\\n", + "316049 California asian_not_hispanic_or_latino \n", + "589366 California asian_not_hispanic_or_latino \n", + "248983 California asian_not_hispanic_or_latino \n", + "18698 Visitor (no home location) NaN \n", + "505861 California white_not_hispanic_or_latino \n", + "\n", + " transit_agency transit_route trip_taker_resident_type \\\n", + "316049 NaN NaN core \n", + "589366 NaN NaN core \n", + "248983 NaN NaN core \n", + "18698 NaN NaN visitor \n", + "505861 NaN NaN core \n", + "\n", + " vehicle_type trip_taker_age activity_id \\\n", + "316049 unknown_vehicle_type 69.0 13927635906260089585 \n", + "589366 unknown_vehicle_type 46.0 7705858213998213664 \n", + "248983 unknown_vehicle_type 51.0 9727666906861881478 \n", + "18698 unknown_vehicle_type NaN 6990046985316847809 \n", + "505861 unknown_vehicle_type 75.0 88254748792768887 \n", + "\n", + " destination_bgrp_2020 destination_building_use \\\n", + "316049 1 (Tract 4287, Alameda, CA) single_family \n", + "589366 3 (Tract 4012, Alameda, CA) non_retail_attraction \n", + "248983 2 (Tract 3580, Contra Costa, CA) retail \n", + "18698 1 (Tract 4230, Alameda, CA) retail \n", + "505861 1 (Tract 3521.02, Contra Costa, CA) single_family \n", + "\n", + " trip_taker_wfh destination_st_2020 \\\n", + "316049 unemployed_under_16_not_in_labor_force California \n", + "589366 remote California \n", + "248983 remote California \n", + "18698 NaN California \n", + "505861 in_person California \n", + "\n", + " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", + "316049 Alameda Does not have work/school location \n", + "589366 Alameda 3 (Tract 6024, San Mateo, CA) \n", + "248983 Contra Costa 1 (Tract 6038.02, San Mateo, CA) \n", + "18698 Alameda Visitor (no work/school location) \n", + "505861 Contra Costa 1 (Tract 615.07, San Francisco, CA) \n", + "\n", + " destination_trct_2020 trip_taker_household_income \\\n", + "316049 4287 (Alameda, CA) 0.0 \n", + "589366 4012 (Alameda, CA) 83424.0 \n", + "248983 3580 (Contra Costa, CA) 207015.0 \n", + "18698 4230 (Alameda, CA) NaN \n", + "505861 3521.02 (Contra Costa, CA) 509711.0 \n", + "\n", + " origin_bgrp_2020 trip_taker_commute_mode \\\n", + "316049 7 (Tract 327, San Francisco, CA) other_travel_mode \n", + "589366 2 (Tract 6041.03, San Mateo, CA) worked_from_home \n", + "248983 1 (Tract 6038.02, San Mateo, CA) worked_from_home \n", + "18698 1 (Tract 110.02, San Francisco, CA) NaN \n", + "505861 1 (Tract 615.07, San Francisco, CA) auto_passenger \n", + "\n", + " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", + "316049 two auto_passenger home \n", + "589366 one auto_passenger work_from_home \n", + "248983 three_plus private_auto home \n", + "18698 NaN auto_passenger shop \n", + "505861 two auto_passenger work \n", + "\n", + " trip_taker_building_type transit_submode \\\n", + "316049 single_family NaN \n", + "589366 multiple_units NaN \n", + "248983 single_family NaN \n", + "18698 NaN NaN \n", + "505861 single_family NaN \n", + "\n", + " trip_taker_work_st_2020 trip_taker_household_size \\\n", + "316049 Does not have work/school location 1.0 \n", + "589366 California 1.0 \n", + "248983 California 3.0 \n", + "18698 Visitor (no work/school location) NaN \n", + "505861 California 2.0 \n", + "\n", + " origin_cty_2020 destination_land_use trip_taker_industry \\\n", + "316049 San Francisco single_family not_working \n", + "589366 San Mateo mixed_use naics621492 \n", + "248983 San Mateo retail naics62 \n", + "18698 San Francisco mixed_use NaN \n", + "505861 San Francisco single_family naics56 \n", + "\n", + " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "316049 owner unknown_fuel_type 327 (San Francisco, CA) \n", + "589366 renter unknown_fuel_type 6041.03 (San Mateo, CA) \n", + "248983 owner other_non_bev 6038.02 (San Mateo, CA) \n", + "18698 NaN unknown_fuel_type Visitor (no home location) \n", + "505861 owner unknown_fuel_type 3521.02 (Contra Costa, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education \\\n", + "316049 Does not have work/school location advanced_degree \n", + "589366 6024 (San Mateo, CA) some_college \n", + "248983 6038.02 (San Mateo, CA) some_college \n", + "18698 Visitor (no work/school location) NaN \n", + "505861 615.07 (San Francisco, CA) some_college \n", + "\n", + " trip_start_time trip_taker_individual_income \\\n", + "316049 05:42:00 0.0 \n", + "589366 10:44:00 83424.0 \n", + "248983 18:24:00 85484.0 \n", + "18698 17:31:08 NaN \n", + "505861 16:39:00 12874.0 \n", + "\n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "316049 not_in_labor_force work single_family \n", + "589366 employed recreation multi_family \n", + "248983 employed shop single_family \n", + "18698 NaN eat mixed_use \n", + "505861 employed home non_retail_attraction \n", + "\n", + " trip_taker_work_cty_2020 trip_distance_miles \\\n", + "316049 Does not have work/school location 24.1 \n", + "589366 San Mateo 22.6 \n", + "248983 San Mateo 38.6 \n", + "18698 Visitor (no work/school location) 13.1 \n", + "505861 San Francisco 21.8 \n", + "\n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "316049 not_attending_school San Francisco \n", + "589366 not_attending_school San Mateo \n", + "248983 not_attending_school San Mateo \n", + "18698 NaN Visitor (no home location) \n", + "505861 not_attending_school Contra Costa \n", + "\n", + " trip_taker_person_id trip_end_time \n", + "316049 18329131915304783635 06:35:44 \n", + "589366 2062283279317414522 11:13:30 \n", + "248983 4488848831358882611 19:23:48 \n", + "18698 17236301087899708165 18:02:42 \n", + "505861 14267323924031043284 17:24:46 " + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips.sample(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "af5533aa-8e0e-43e9-bcef-85a3ec252e8e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "674864" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(r_trips)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", + "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", + "
trip_taker_household_idn
24868627897
262322NaN16384
110604819421956364075181528
82299609777131291778859627
74914555246788117181473022
.........
26231299884893668902201881
26231699913423094393305601
26231799924909034298666651
26231899925996610099430061
26231999935884836945191521
\n", + "

262323 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " trip_taker_household_id n\n", + "248686 27897\n", + "262322 NaN 16384\n", + "110604 8194219563640751815 28\n", + "82299 6097771312917788596 27\n", + "74914 5552467881171814730 22\n", + "... ... ...\n", + "262312 9988489366890220188 1\n", + "262316 9991342309439330560 1\n", + "262317 9992490903429866665 1\n", + "262318 9992599661009943006 1\n", + "262319 9993588483694519152 1\n", + "\n", + "[262323 rows x 2 columns]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>count(_.trip_taker_household_id)>>arrange(-_.n)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "34f3079c-34b8-41e6-be02-ade8f229926a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
origin_building_usetrip_duration_minutestrip_taker_languageorigin_trct_2020trip_taker_household_idtrip_taker_sextrip_taker_home_bgrp_2020origin_st_2020trip_taker_home_st_2020trip_taker_race_ethnicitytransit_agencytransit_routetrip_taker_resident_typevehicle_typetrip_taker_ageactivity_iddestination_bgrp_2020destination_building_usetrip_taker_wfhdestination_st_2020destination_cty_2020trip_taker_work_bgrp_2020destination_trct_2020trip_taker_household_incomeorigin_bgrp_2020trip_taker_commute_modetrip_taker_available_vehiclesprimary_modeprevious_trip_purposetrip_taker_building_typetransit_submodetrip_taker_work_st_2020trip_taker_household_sizeorigin_cty_2020destination_land_usetrip_taker_industrytrip_taker_tenurevehicle_fuel_typetrip_taker_home_trct_2020trip_taker_work_trct_2020trip_taker_educationtrip_start_timetrip_taker_individual_incometrip_taker_employment_statustrip_purposeorigin_land_usetrip_taker_work_cty_2020trip_distance_milestrip_taker_school_grade_attendingtrip_taker_home_cty_2020trip_taker_person_idtrip_end_time
115980single_family8indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.0116497427602101522902 (Tract 180, San Francisco, CA)industrialin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)180 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)private_autothree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoindustrialnaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree07:26:00136907.0employedworksingle_familySan Francisco4.3not_attending_schoolSan Francisco1006625502873496796207:34:11
116099industrial8indo_european180 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.035279292296024459791 (Tract 179.03, San Francisco, CA)single_familyin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 180, San Francisco, CA)private_autothree_plusauto_passengerworksingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree10:34:00136907.0employedhomeindustrialSan Francisco4.4not_attending_schoolSan Francisco1006625502873496796210:42:11
257674retail20indo_european4028.01 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.0176072582217114658141 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 4028.01, Alameda, CA)worked_from_homethree_plusprivate_autoshopsingle_familyNaNCalifornia10.0Alamedasingle_familynaics62renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree17:23:0076878.0employedhomeretailSan Francisco8.3not_attending_schoolSan Francisco132518174655286855417:43:25
257680retail6indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.042581078924317635031 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree23:59:00218735.0employedhomemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981100:05:27
257681retail18indo_european4024 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0126733592554790094421 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 4024, Alameda, CA)worked_from_homethree_plusauto_passengereatsingle_familyNaNCalifornia10.0Alamedasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree20:21:0058975.0employedhomeretailSan Francisco8.4not_attending_schoolSan Francisco231033106690090267920:39:52
257700single_family20indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.0117962098623958508221 (Tract 4028.01, Alameda, CA)retailremoteCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree18:16:0076878.0employedshopsingle_familySan Francisco8.8not_attending_schoolSan Francisco132518174655286855418:36:37
257740retail18indo_european4028.01 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.029071925784277998261 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 4028.01, Alameda, CA)worked_from_homethree_plusprivate_autoshopsingle_familyNaNCalifornia10.0Alamedasingle_familynaics62renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree20:25:0076878.0employedhomeretailSan Francisco8.3not_attending_schoolSan Francisco132518174655286855420:43:21
257742retail25indo_european131.01 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type32.051918639015747599111 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.04 (Tract 131.01, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree13:52:00184297.0employedwork_from_homemixed_useSan Francisco7.7not_attending_schoolSan Francisco1105847776148723085414:17:22
257752open_space13indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type34.0142400362149783507001 (Tract 125.03, San Francisco, CA)retailremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)125.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerrecreationsingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree07:53:00141119.0employedeatmixed_useSan Francisco4.7not_attending_schoolSan Francisco474683141297534907008:06:39
257766single_family25indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.021376383045737346732 (Tract 3690.01, Contra Costa, CA)officeemployed_not_workingCaliforniaContra Costa1 (Tract 179.03, San Francisco, CA)3690.01 (Contra Costa, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoofficenaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree09:07:0058975.0employedshopsingle_familySan Francisco15.3not_attending_schoolSan Francisco231033106690090267909:32:34
257782single_family21indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type32.0105450082426352247834 (Tract 131.01, San Francisco, CA)retailremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)131.01 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree13:18:00184297.0employedshopsingle_familySan Francisco7.6not_attending_schoolSan Francisco1105847776148723085413:39:06
319406retail6indo_european615.07 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type39.094317011050365135501 (Tract 179.03, San Francisco, CA)single_familyunemployed_under_16_not_in_labor_forceCaliforniaSan FranciscoDoes not have work/school location179.03 (San Francisco, CA)1200990.01 (Tract 615.07, San Francisco, CA)other_travel_modethree_plusauto_passengereatsingle_familyNaNDoes not have work/school location10.0San Franciscosingle_familynaics72renterunknown_fuel_type179.03 (San Francisco, CA)Does not have work/school locationhigh_school22:00:0078984.0unemployedhomemixed_useDoes not have work/school location3.7not_attending_schoolSan Francisco1289494630026574219322:06:39
453990single_family31indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.021835416939884039682 (Tract 231.03, San Francisco, CA)industrialin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)231.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)private_autothree_plusprivate_autohomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterother_non_bev179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree12:44:00136907.0employedmaintenancesingle_familySan Francisco9.6not_attending_schoolSan Francisco1006625502873496796213:15:05
454315single_family30indo_european6019.01 (San Mateo, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.024323779474769505221 (Tract 179.03, San Francisco, CA)single_familyin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 6019.01, San Mateo, CA)private_autothree_plusprivate_autosocialsingle_familyNaNCalifornia10.0San Mateosingle_familynaics31_33renterother_non_bev179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree19:53:00136907.0employedhomesingle_familySan Francisco15.0not_attending_schoolSan Francisco1006625502873496796220:23:26
594828single_family10indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0158851067883991515563 (Tract 615.06, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)615.06 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusprivate_autowork_from_homesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics54renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree22:30:00218735.0employedshopsingle_familySan Francisco4.0not_attending_schoolSan Francisco1440969234057495981122:40:27
594837single_family27indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.08124378838850198162 (Tract 3690.01, Contra Costa, CA)officeemployed_not_workingCaliforniaContra Costa1 (Tract 179.03, San Francisco, CA)3690.01 (Contra Costa, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoofficenaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:15:0058975.0employedshopsingle_familySan Francisco15.3not_attending_schoolSan Francisco231033106690090267915:42:31
594840retail7indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0128416754049579796411 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree12:50:00218735.0employedwork_from_homemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981112:57:01
594856single_family11indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.078783471048378956383 (Tract 615.06, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)615.06 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusprivate_autohomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics54renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:44:00218735.0employedshopsingle_familySan Francisco4.0not_attending_schoolSan Francisco1440969234057495981111:55:07
594859single_family19indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0170742202348262979312 (Tract 4024, Alameda, CA)retailemployed_not_workingCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4024 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree19:08:0058975.0employedeatsingle_familySan Francisco8.5not_attending_schoolSan Francisco231033106690090267919:27:48
594862single_family14indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.070171872167603447431 (Tract 4028.01, Alameda, CA)retailremoteCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerwork_from_homesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree16:09:0076878.0employedshopsingle_familySan Francisco7.6not_attending_schoolSan Francisco132518174655286855416:23:22
594873office25indo_european3690.01 (Contra Costa, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0158848542161360155521 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0Contra Costasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:50:3158975.0employedhomeofficeSan Francisco14.9not_attending_schoolSan Francisco231033106690090267916:16:28
594877retail13indo_european125.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type34.027828652091505974131 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 125.03, San Francisco, CA)worked_from_homethree_plusauto_passengereatsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree09:55:00141119.0employedwork_from_homemixed_useSan Francisco4.9not_attending_schoolSan Francisco474683141297534907010:08:11
594894single_family9indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.046418471271854126672 (Tract 176.02, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)176.02 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree13:50:0076878.0employedshopsingle_familySan Francisco4.8not_attending_schoolSan Francisco132518174655286855413:59:55
594901office23indo_european3690.01 (Contra Costa, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0154662223374951985911 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0Contra Costasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree13:10:0058975.0employedhomeofficeSan Francisco14.9not_attending_schoolSan Francisco231033106690090267913:33:44
594935single_family14indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0135315509748273377653 (Tract 117, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)117 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree09:18:00218735.0employedshopsingle_familySan Francisco5.0not_attending_schoolSan Francisco1440969234057495981109:32:26
594962retail16indo_european176.02 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.019671048820994471501 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 176.02, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree14:31:0076878.0employedwork_from_homeretailSan Francisco4.8not_attending_schoolSan Francisco132518174655286855414:47:49
594972retail6indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.013973907958114505021 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:24:00218735.0employedhomemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981111:30:46
656110single_family9indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type39.0135410986435712566981 (Tract 615.07, San Francisco, CA)retailunemployed_under_16_not_in_labor_forceCaliforniaSan FranciscoDoes not have work/school location615.07 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)other_travel_modethree_plusprivate_autohomesingle_familyNaNDoes not have work/school location10.0San Franciscomixed_usenaics72renterother_non_bev179.03 (San Francisco, CA)Does not have work/school locationhigh_school18:10:0078984.0unemployedeatsingle_familyDoes not have work/school location3.9not_attending_schoolSan Francisco1289494630026574219318:19:12
\n", + "
" + ], + "text/plain": [ + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "115980 single_family 8 indo_european \n", + "116099 industrial 8 indo_european \n", + "257674 retail 20 indo_european \n", + "257680 retail 6 indo_european \n", + "257681 retail 18 indo_european \n", + "257700 single_family 20 indo_european \n", + "257740 retail 18 indo_european \n", + "257742 retail 25 indo_european \n", + "257752 open_space 13 indo_european \n", + "257766 single_family 25 indo_european \n", + "257782 single_family 21 indo_european \n", + "319406 retail 6 indo_european \n", + "453990 single_family 31 indo_european \n", + "454315 single_family 30 indo_european \n", + "594828 single_family 10 indo_european \n", + "594837 single_family 27 indo_european \n", + "594840 retail 7 indo_european \n", + "594856 single_family 11 indo_european \n", + "594859 single_family 19 indo_european \n", + "594862 single_family 14 indo_european \n", + "594873 office 25 indo_european \n", + "594877 retail 13 indo_european \n", + "594894 single_family 9 indo_european \n", + "594901 office 23 indo_european \n", + "594935 single_family 14 indo_european \n", + "594962 retail 16 indo_european \n", + "594972 retail 6 indo_european \n", + "656110 single_family 9 indo_european \n", + "\n", + " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", + "115980 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "116099 180 (San Francisco, CA) 8194219563640751815 male \n", + "257674 4028.01 (Alameda, CA) 8194219563640751815 female \n", + "257680 615.06 (San Francisco, CA) 8194219563640751815 male \n", + "257681 4024 (Alameda, CA) 8194219563640751815 female \n", + "257700 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "257740 4028.01 (Alameda, CA) 8194219563640751815 female \n", + "257742 131.01 (San Francisco, CA) 8194219563640751815 male \n", + "257752 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "257766 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "257782 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "319406 615.07 (San Francisco, CA) 8194219563640751815 male \n", + "453990 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "454315 6019.01 (San Mateo, CA) 8194219563640751815 male \n", + "594828 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "594837 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "594840 615.06 (San Francisco, CA) 8194219563640751815 male \n", + "594856 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "594859 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "594862 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "594873 3690.01 (Contra Costa, CA) 8194219563640751815 female \n", + "594877 125.03 (San Francisco, CA) 8194219563640751815 female \n", + "594894 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "594901 3690.01 (Contra Costa, CA) 8194219563640751815 female \n", + "594935 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "594962 176.02 (San Francisco, CA) 8194219563640751815 female \n", + "594972 615.06 (San Francisco, CA) 8194219563640751815 male \n", + "656110 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "\n", + " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", + "115980 1 (Tract 179.03, San Francisco, CA) California \n", + "116099 1 (Tract 179.03, San Francisco, CA) California \n", + "257674 1 (Tract 179.03, San Francisco, CA) California \n", + "257680 1 (Tract 179.03, San Francisco, CA) California \n", + "257681 1 (Tract 179.03, San Francisco, CA) California \n", + "257700 1 (Tract 179.03, San Francisco, CA) California \n", + "257740 1 (Tract 179.03, San Francisco, CA) California \n", + "257742 1 (Tract 179.03, San Francisco, CA) California \n", + "257752 1 (Tract 179.03, San Francisco, CA) California \n", + "257766 1 (Tract 179.03, San Francisco, CA) California \n", + "257782 1 (Tract 179.03, San Francisco, CA) California \n", + "319406 1 (Tract 179.03, San Francisco, CA) California \n", + "453990 1 (Tract 179.03, San Francisco, CA) California \n", + "454315 1 (Tract 179.03, San Francisco, CA) California \n", + "594828 1 (Tract 179.03, San Francisco, CA) California \n", + "594837 1 (Tract 179.03, San Francisco, CA) California \n", + "594840 1 (Tract 179.03, San Francisco, CA) California \n", + "594856 1 (Tract 179.03, San Francisco, CA) California \n", + "594859 1 (Tract 179.03, San Francisco, CA) California \n", + "594862 1 (Tract 179.03, San Francisco, CA) California \n", + "594873 1 (Tract 179.03, San Francisco, CA) California \n", + "594877 1 (Tract 179.03, San Francisco, CA) California \n", + "594894 1 (Tract 179.03, San Francisco, CA) California \n", + "594901 1 (Tract 179.03, San Francisco, CA) California \n", + "594935 1 (Tract 179.03, San Francisco, CA) California \n", + "594962 1 (Tract 179.03, San Francisco, CA) California \n", + "594972 1 (Tract 179.03, San Francisco, CA) California \n", + "656110 1 (Tract 179.03, San Francisco, CA) California \n", + "\n", + " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", + "115980 California hispanic_or_latino_origin NaN \n", + "116099 California hispanic_or_latino_origin NaN \n", + "257674 California asian_not_hispanic_or_latino NaN \n", + "257680 California white_not_hispanic_or_latino NaN \n", + "257681 California white_not_hispanic_or_latino NaN \n", + "257700 California asian_not_hispanic_or_latino NaN \n", + "257740 California asian_not_hispanic_or_latino NaN \n", + "257742 California white_not_hispanic_or_latino NaN \n", + "257752 California white_not_hispanic_or_latino NaN \n", + "257766 California white_not_hispanic_or_latino NaN \n", + "257782 California white_not_hispanic_or_latino NaN \n", + "319406 California asian_not_hispanic_or_latino NaN \n", + "453990 California hispanic_or_latino_origin NaN \n", + "454315 California hispanic_or_latino_origin NaN \n", + "594828 California white_not_hispanic_or_latino NaN \n", + "594837 California white_not_hispanic_or_latino NaN \n", + "594840 California white_not_hispanic_or_latino NaN \n", + "594856 California white_not_hispanic_or_latino NaN \n", + "594859 California white_not_hispanic_or_latino NaN \n", + "594862 California asian_not_hispanic_or_latino NaN \n", + "594873 California white_not_hispanic_or_latino NaN \n", + "594877 California white_not_hispanic_or_latino NaN \n", + "594894 California asian_not_hispanic_or_latino NaN \n", + "594901 California white_not_hispanic_or_latino NaN \n", + "594935 California white_not_hispanic_or_latino NaN \n", + "594962 California asian_not_hispanic_or_latino NaN \n", + "594972 California white_not_hispanic_or_latino NaN \n", + "656110 California asian_not_hispanic_or_latino NaN \n", + "\n", + " transit_route trip_taker_resident_type vehicle_type \\\n", + "115980 NaN core unknown_vehicle_type \n", + "116099 NaN core unknown_vehicle_type \n", + "257674 NaN core unknown_vehicle_type \n", + "257680 NaN core unknown_vehicle_type \n", + "257681 NaN core unknown_vehicle_type \n", + "257700 NaN core unknown_vehicle_type \n", + "257740 NaN core unknown_vehicle_type \n", + "257742 NaN core unknown_vehicle_type \n", + "257752 NaN core unknown_vehicle_type \n", + "257766 NaN core unknown_vehicle_type \n", + "257782 NaN core unknown_vehicle_type \n", + "319406 NaN core unknown_vehicle_type \n", + "453990 NaN core unknown_vehicle_type \n", + "454315 NaN core unknown_vehicle_type \n", + "594828 NaN core unknown_vehicle_type \n", + "594837 NaN core unknown_vehicle_type \n", + "594840 NaN core unknown_vehicle_type \n", + "594856 NaN core unknown_vehicle_type \n", + "594859 NaN core unknown_vehicle_type \n", + "594862 NaN core unknown_vehicle_type \n", + "594873 NaN core unknown_vehicle_type \n", + "594877 NaN core unknown_vehicle_type \n", + "594894 NaN core unknown_vehicle_type \n", + "594901 NaN core unknown_vehicle_type \n", + "594935 NaN core unknown_vehicle_type \n", + "594962 NaN core unknown_vehicle_type \n", + "594972 NaN core unknown_vehicle_type \n", + "656110 NaN core unknown_vehicle_type \n", + "\n", + " trip_taker_age activity_id \\\n", + "115980 28.0 11649742760210152290 \n", + "116099 28.0 3527929229602445979 \n", + "257674 22.0 17607258221711465814 \n", + "257680 27.0 4258107892431763503 \n", + "257681 30.0 12673359255479009442 \n", + "257700 22.0 11796209862395850822 \n", + "257740 22.0 2907192578427799826 \n", + "257742 32.0 5191863901574759911 \n", + "257752 34.0 14240036214978350700 \n", + "257766 30.0 2137638304573734673 \n", + "257782 32.0 10545008242635224783 \n", + "319406 39.0 9431701105036513550 \n", + "453990 28.0 2183541693988403968 \n", + "454315 28.0 2432377947476950522 \n", + "594828 27.0 15885106788399151556 \n", + "594837 30.0 812437883885019816 \n", + "594840 27.0 12841675404957979641 \n", + "594856 27.0 7878347104837895638 \n", + "594859 30.0 17074220234826297931 \n", + "594862 22.0 7017187216760344743 \n", + "594873 30.0 15884854216136015552 \n", + "594877 34.0 2782865209150597413 \n", + "594894 22.0 4641847127185412667 \n", + "594901 30.0 15466222337495198591 \n", + "594935 27.0 13531550974827337765 \n", + "594962 22.0 1967104882099447150 \n", + "594972 27.0 1397390795811450502 \n", + "656110 39.0 13541098643571256698 \n", + "\n", + " destination_bgrp_2020 destination_building_use \\\n", + "115980 2 (Tract 180, San Francisco, CA) industrial \n", + "116099 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257674 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257680 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257681 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257700 1 (Tract 4028.01, Alameda, CA) retail \n", + "257740 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257742 1 (Tract 179.03, San Francisco, CA) single_family \n", + "257752 1 (Tract 125.03, San Francisco, CA) retail \n", + "257766 2 (Tract 3690.01, Contra Costa, CA) office \n", + "257782 4 (Tract 131.01, San Francisco, CA) retail \n", + "319406 1 (Tract 179.03, San Francisco, CA) single_family \n", + "453990 2 (Tract 231.03, San Francisco, CA) industrial \n", + "454315 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594828 3 (Tract 615.06, San Francisco, CA) retail \n", + "594837 2 (Tract 3690.01, Contra Costa, CA) office \n", + "594840 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594856 3 (Tract 615.06, San Francisco, CA) retail \n", + "594859 2 (Tract 4024, Alameda, CA) retail \n", + "594862 1 (Tract 4028.01, Alameda, CA) retail \n", + "594873 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594877 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594894 2 (Tract 176.02, San Francisco, CA) retail \n", + "594901 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594935 3 (Tract 117, San Francisco, CA) retail \n", + "594962 1 (Tract 179.03, San Francisco, CA) single_family \n", + "594972 1 (Tract 179.03, San Francisco, CA) single_family \n", + "656110 1 (Tract 615.07, San Francisco, CA) retail \n", + "\n", + " trip_taker_wfh destination_st_2020 \\\n", + "115980 in_person California \n", + "116099 in_person California \n", + "257674 remote California \n", + "257680 remote California \n", + "257681 employed_not_working California \n", + "257700 remote California \n", + "257740 remote California \n", + "257742 remote California \n", + "257752 remote California \n", + "257766 employed_not_working California \n", + "257782 remote California \n", + "319406 unemployed_under_16_not_in_labor_force California \n", + "453990 in_person California \n", + "454315 in_person California \n", + "594828 remote California \n", + "594837 employed_not_working California \n", + "594840 remote California \n", + "594856 remote California \n", + "594859 employed_not_working California \n", + "594862 remote California \n", + "594873 employed_not_working California \n", + "594877 remote California \n", + "594894 remote California \n", + "594901 employed_not_working California \n", + "594935 remote California \n", + "594962 remote California \n", + "594972 remote California \n", + "656110 unemployed_under_16_not_in_labor_force California \n", + "\n", + " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", + "115980 San Francisco 2 (Tract 180, San Francisco, CA) \n", + "116099 San Francisco 2 (Tract 180, San Francisco, CA) \n", + "257674 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "257680 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "257681 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "257700 Alameda 1 (Tract 179.03, San Francisco, CA) \n", + "257740 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "257742 San Francisco 2 (Tract 231.03, San Francisco, CA) \n", + "257752 San Francisco 2 (Tract 231.03, San Francisco, CA) \n", + "257766 Contra Costa 1 (Tract 179.03, San Francisco, CA) \n", + "257782 San Francisco 2 (Tract 231.03, San Francisco, CA) \n", + "319406 San Francisco Does not have work/school location \n", + "453990 San Francisco 2 (Tract 180, San Francisco, CA) \n", + "454315 San Francisco 2 (Tract 180, San Francisco, CA) \n", + "594828 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594837 Contra Costa 1 (Tract 179.03, San Francisco, CA) \n", + "594840 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594856 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594859 Alameda 1 (Tract 179.03, San Francisco, CA) \n", + "594862 Alameda 1 (Tract 179.03, San Francisco, CA) \n", + "594873 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594877 San Francisco 2 (Tract 231.03, San Francisco, CA) \n", + "594894 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594901 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594935 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594962 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "594972 San Francisco 1 (Tract 179.03, San Francisco, CA) \n", + "656110 San Francisco Does not have work/school location \n", + "\n", + " destination_trct_2020 trip_taker_household_income \\\n", + "115980 180 (San Francisco, CA) 1200990.0 \n", + "116099 179.03 (San Francisco, CA) 1200990.0 \n", + "257674 179.03 (San Francisco, CA) 1200990.0 \n", + "257680 179.03 (San Francisco, CA) 1200990.0 \n", + "257681 179.03 (San Francisco, CA) 1200990.0 \n", + "257700 4028.01 (Alameda, CA) 1200990.0 \n", + "257740 179.03 (San Francisco, CA) 1200990.0 \n", + "257742 179.03 (San Francisco, CA) 1200990.0 \n", + "257752 125.03 (San Francisco, CA) 1200990.0 \n", + "257766 3690.01 (Contra Costa, CA) 1200990.0 \n", + "257782 131.01 (San Francisco, CA) 1200990.0 \n", + "319406 179.03 (San Francisco, CA) 1200990.0 \n", + "453990 231.03 (San Francisco, CA) 1200990.0 \n", + "454315 179.03 (San Francisco, CA) 1200990.0 \n", + "594828 615.06 (San Francisco, CA) 1200990.0 \n", + "594837 3690.01 (Contra Costa, CA) 1200990.0 \n", + "594840 179.03 (San Francisco, CA) 1200990.0 \n", + "594856 615.06 (San Francisco, CA) 1200990.0 \n", + "594859 4024 (Alameda, CA) 1200990.0 \n", + "594862 4028.01 (Alameda, CA) 1200990.0 \n", + "594873 179.03 (San Francisco, CA) 1200990.0 \n", + "594877 179.03 (San Francisco, CA) 1200990.0 \n", + "594894 176.02 (San Francisco, CA) 1200990.0 \n", + "594901 179.03 (San Francisco, CA) 1200990.0 \n", + "594935 117 (San Francisco, CA) 1200990.0 \n", + "594962 179.03 (San Francisco, CA) 1200990.0 \n", + "594972 179.03 (San Francisco, CA) 1200990.0 \n", + "656110 615.07 (San Francisco, CA) 1200990.0 \n", + "\n", + " origin_bgrp_2020 trip_taker_commute_mode \\\n", + "115980 1 (Tract 179.03, San Francisco, CA) private_auto \n", + "116099 2 (Tract 180, San Francisco, CA) private_auto \n", + "257674 1 (Tract 4028.01, Alameda, CA) worked_from_home \n", + "257680 3 (Tract 615.06, San Francisco, CA) worked_from_home \n", + "257681 2 (Tract 4024, Alameda, CA) worked_from_home \n", + "257700 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "257740 1 (Tract 4028.01, Alameda, CA) worked_from_home \n", + "257742 4 (Tract 131.01, San Francisco, CA) worked_from_home \n", + "257752 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "257766 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "257782 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "319406 1 (Tract 615.07, San Francisco, CA) other_travel_mode \n", + "453990 1 (Tract 179.03, San Francisco, CA) private_auto \n", + "454315 1 (Tract 6019.01, San Mateo, CA) private_auto \n", + "594828 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594837 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594840 3 (Tract 615.06, San Francisco, CA) worked_from_home \n", + "594856 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594859 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594862 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594873 2 (Tract 3690.01, Contra Costa, CA) worked_from_home \n", + "594877 1 (Tract 125.03, San Francisco, CA) worked_from_home \n", + "594894 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594901 2 (Tract 3690.01, Contra Costa, CA) worked_from_home \n", + "594935 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", + "594962 2 (Tract 176.02, San Francisco, CA) worked_from_home \n", + "594972 3 (Tract 615.06, San Francisco, CA) worked_from_home \n", + "656110 1 (Tract 179.03, San Francisco, CA) other_travel_mode \n", + "\n", + " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", + "115980 three_plus auto_passenger home \n", + "116099 three_plus auto_passenger work \n", + "257674 three_plus private_auto shop \n", + "257680 three_plus auto_passenger shop \n", + "257681 three_plus auto_passenger eat \n", + "257700 three_plus auto_passenger home \n", + "257740 three_plus private_auto shop \n", + "257742 three_plus auto_passenger shop \n", + "257752 three_plus auto_passenger recreation \n", + "257766 three_plus auto_passenger home \n", + "257782 three_plus auto_passenger home \n", + "319406 three_plus auto_passenger eat \n", + "453990 three_plus private_auto home \n", + "454315 three_plus private_auto social \n", + "594828 three_plus private_auto work_from_home \n", + "594837 three_plus auto_passenger home \n", + "594840 three_plus auto_passenger shop \n", + "594856 three_plus private_auto home \n", + "594859 three_plus auto_passenger home \n", + "594862 three_plus auto_passenger work_from_home \n", + "594873 three_plus auto_passenger shop \n", + "594877 three_plus auto_passenger eat \n", + "594894 three_plus auto_passenger home \n", + "594901 three_plus auto_passenger shop \n", + "594935 three_plus auto_passenger home \n", + "594962 three_plus auto_passenger shop \n", + "594972 three_plus auto_passenger shop \n", + "656110 three_plus private_auto home \n", + "\n", + " trip_taker_building_type transit_submode \\\n", + "115980 single_family NaN \n", + "116099 single_family NaN \n", + "257674 single_family NaN \n", + "257680 single_family NaN \n", + "257681 single_family NaN \n", + "257700 single_family NaN \n", + "257740 single_family NaN \n", + "257742 single_family NaN \n", + "257752 single_family NaN \n", + "257766 single_family NaN \n", + "257782 single_family NaN \n", + "319406 single_family NaN \n", + "453990 single_family NaN \n", + "454315 single_family NaN \n", + "594828 single_family NaN \n", + "594837 single_family NaN \n", + "594840 single_family NaN \n", + "594856 single_family NaN \n", + "594859 single_family NaN \n", + "594862 single_family NaN \n", + "594873 single_family NaN \n", + "594877 single_family NaN \n", + "594894 single_family NaN \n", + "594901 single_family NaN \n", + "594935 single_family NaN \n", + "594962 single_family NaN \n", + "594972 single_family NaN \n", + "656110 single_family NaN \n", + "\n", + " trip_taker_work_st_2020 trip_taker_household_size \\\n", + "115980 California 10.0 \n", + "116099 California 10.0 \n", + "257674 California 10.0 \n", + "257680 California 10.0 \n", + "257681 California 10.0 \n", + "257700 California 10.0 \n", + "257740 California 10.0 \n", + "257742 California 10.0 \n", + "257752 California 10.0 \n", + "257766 California 10.0 \n", + "257782 California 10.0 \n", + "319406 Does not have work/school location 10.0 \n", + "453990 California 10.0 \n", + "454315 California 10.0 \n", + "594828 California 10.0 \n", + "594837 California 10.0 \n", + "594840 California 10.0 \n", + "594856 California 10.0 \n", + "594859 California 10.0 \n", + "594862 California 10.0 \n", + "594873 California 10.0 \n", + "594877 California 10.0 \n", + "594894 California 10.0 \n", + "594901 California 10.0 \n", + "594935 California 10.0 \n", + "594962 California 10.0 \n", + "594972 California 10.0 \n", + "656110 Does not have work/school location 10.0 \n", + "\n", + " origin_cty_2020 destination_land_use trip_taker_industry \\\n", + "115980 San Francisco industrial naics31_33 \n", + "116099 San Francisco single_family naics31_33 \n", + "257674 Alameda single_family naics62 \n", + "257680 San Francisco single_family naics54 \n", + "257681 Alameda single_family naics61 \n", + "257700 San Francisco retail naics62 \n", + "257740 Alameda single_family naics62 \n", + "257742 San Francisco single_family naics31_33 \n", + "257752 San Francisco mixed_use naics31_33 \n", + "257766 San Francisco office naics61 \n", + "257782 San Francisco mixed_use naics31_33 \n", + "319406 San Francisco single_family naics72 \n", + "453990 San Francisco mixed_use naics31_33 \n", + "454315 San Mateo single_family naics31_33 \n", + "594828 San Francisco mixed_use naics54 \n", + "594837 San Francisco office naics61 \n", + "594840 San Francisco single_family naics54 \n", + "594856 San Francisco mixed_use naics54 \n", + "594859 San Francisco retail naics61 \n", + "594862 San Francisco retail naics62 \n", + "594873 Contra Costa single_family naics61 \n", + "594877 San Francisco single_family naics31_33 \n", + "594894 San Francisco retail naics62 \n", + "594901 Contra Costa single_family naics61 \n", + "594935 San Francisco retail naics54 \n", + "594962 San Francisco single_family naics62 \n", + "594972 San Francisco single_family naics54 \n", + "656110 San Francisco mixed_use naics72 \n", + "\n", + " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "115980 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "116099 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257674 renter other_non_bev 179.03 (San Francisco, CA) \n", + "257680 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257681 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257700 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257740 renter other_non_bev 179.03 (San Francisco, CA) \n", + "257742 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257752 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257766 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257782 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "319406 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "453990 renter other_non_bev 179.03 (San Francisco, CA) \n", + "454315 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594828 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594837 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594840 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594856 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594859 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594862 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594873 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594877 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594894 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594901 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594935 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594962 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594972 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "656110 renter other_non_bev 179.03 (San Francisco, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education \\\n", + "115980 180 (San Francisco, CA) bachelors_degree \n", + "116099 180 (San Francisco, CA) bachelors_degree \n", + "257674 179.03 (San Francisco, CA) bachelors_degree \n", + "257680 179.03 (San Francisco, CA) bachelors_degree \n", + "257681 179.03 (San Francisco, CA) bachelors_degree \n", + "257700 179.03 (San Francisco, CA) bachelors_degree \n", + "257740 179.03 (San Francisco, CA) bachelors_degree \n", + "257742 231.03 (San Francisco, CA) bachelors_degree \n", + "257752 231.03 (San Francisco, CA) bachelors_degree \n", + "257766 179.03 (San Francisco, CA) bachelors_degree \n", + "257782 231.03 (San Francisco, CA) bachelors_degree \n", + "319406 Does not have work/school location high_school \n", + "453990 180 (San Francisco, CA) bachelors_degree \n", + "454315 180 (San Francisco, CA) bachelors_degree \n", + "594828 179.03 (San Francisco, CA) bachelors_degree \n", + "594837 179.03 (San Francisco, CA) bachelors_degree \n", + "594840 179.03 (San Francisco, CA) bachelors_degree \n", + "594856 179.03 (San Francisco, CA) bachelors_degree \n", + "594859 179.03 (San Francisco, CA) bachelors_degree \n", + "594862 179.03 (San Francisco, CA) bachelors_degree \n", + "594873 179.03 (San Francisco, CA) bachelors_degree \n", + "594877 231.03 (San Francisco, CA) bachelors_degree \n", + "594894 179.03 (San Francisco, CA) bachelors_degree \n", + "594901 179.03 (San Francisco, CA) bachelors_degree \n", + "594935 179.03 (San Francisco, CA) bachelors_degree \n", + "594962 179.03 (San Francisco, CA) bachelors_degree \n", + "594972 179.03 (San Francisco, CA) bachelors_degree \n", + "656110 Does not have work/school location high_school \n", + "\n", + " trip_start_time trip_taker_individual_income \\\n", + "115980 07:26:00 136907.0 \n", + "116099 10:34:00 136907.0 \n", + "257674 17:23:00 76878.0 \n", + "257680 23:59:00 218735.0 \n", + "257681 20:21:00 58975.0 \n", + "257700 18:16:00 76878.0 \n", + "257740 20:25:00 76878.0 \n", + "257742 13:52:00 184297.0 \n", + "257752 07:53:00 141119.0 \n", + "257766 09:07:00 58975.0 \n", + "257782 13:18:00 184297.0 \n", + "319406 22:00:00 78984.0 \n", + "453990 12:44:00 136907.0 \n", + "454315 19:53:00 136907.0 \n", + "594828 22:30:00 218735.0 \n", + "594837 15:15:00 58975.0 \n", + "594840 12:50:00 218735.0 \n", + "594856 11:44:00 218735.0 \n", + "594859 19:08:00 58975.0 \n", + "594862 16:09:00 76878.0 \n", + "594873 15:50:31 58975.0 \n", + "594877 09:55:00 141119.0 \n", + "594894 13:50:00 76878.0 \n", + "594901 13:10:00 58975.0 \n", + "594935 09:18:00 218735.0 \n", + "594962 14:31:00 76878.0 \n", + "594972 11:24:00 218735.0 \n", + "656110 18:10:00 78984.0 \n", + "\n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "115980 employed work single_family \n", + "116099 employed home industrial \n", + "257674 employed home retail \n", + "257680 employed home mixed_use \n", + "257681 employed home retail \n", + "257700 employed shop single_family \n", + "257740 employed home retail \n", + "257742 employed work_from_home mixed_use \n", + "257752 employed eat mixed_use \n", + "257766 employed shop single_family \n", + "257782 employed shop single_family \n", + "319406 unemployed home mixed_use \n", + "453990 employed maintenance single_family \n", + "454315 employed home single_family \n", + "594828 employed shop single_family \n", + "594837 employed shop single_family \n", + "594840 employed work_from_home mixed_use \n", + "594856 employed shop single_family \n", + "594859 employed eat single_family \n", + "594862 employed shop single_family \n", + "594873 employed home office \n", + "594877 employed work_from_home mixed_use \n", + "594894 employed shop single_family \n", + "594901 employed home office \n", + "594935 employed shop single_family \n", + "594962 employed work_from_home retail \n", + "594972 employed home mixed_use \n", + "656110 unemployed eat single_family \n", + "\n", + " trip_taker_work_cty_2020 trip_distance_miles \\\n", + "115980 San Francisco 4.3 \n", + "116099 San Francisco 4.4 \n", + "257674 San Francisco 8.3 \n", + "257680 San Francisco 3.7 \n", + "257681 San Francisco 8.4 \n", + "257700 San Francisco 8.8 \n", + "257740 San Francisco 8.3 \n", + "257742 San Francisco 7.7 \n", + "257752 San Francisco 4.7 \n", + "257766 San Francisco 15.3 \n", + "257782 San Francisco 7.6 \n", + "319406 Does not have work/school location 3.7 \n", + "453990 San Francisco 9.6 \n", + "454315 San Francisco 15.0 \n", + "594828 San Francisco 4.0 \n", + "594837 San Francisco 15.3 \n", + "594840 San Francisco 3.7 \n", + "594856 San Francisco 4.0 \n", + "594859 San Francisco 8.5 \n", + "594862 San Francisco 7.6 \n", + "594873 San Francisco 14.9 \n", + "594877 San Francisco 4.9 \n", + "594894 San Francisco 4.8 \n", + "594901 San Francisco 14.9 \n", + "594935 San Francisco 5.0 \n", + "594962 San Francisco 4.8 \n", + "594972 San Francisco 3.7 \n", + "656110 Does not have work/school location 3.9 \n", + "\n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "115980 not_attending_school San Francisco \n", + "116099 not_attending_school San Francisco \n", + "257674 not_attending_school San Francisco \n", + "257680 not_attending_school San Francisco \n", + "257681 not_attending_school San Francisco \n", + "257700 not_attending_school San Francisco \n", + "257740 not_attending_school San Francisco \n", + "257742 not_attending_school San Francisco \n", + "257752 not_attending_school San Francisco \n", + "257766 not_attending_school San Francisco \n", + "257782 not_attending_school San Francisco \n", + "319406 not_attending_school San Francisco \n", + "453990 not_attending_school San Francisco \n", + "454315 not_attending_school San Francisco \n", + "594828 not_attending_school San Francisco \n", + "594837 not_attending_school San Francisco \n", + "594840 not_attending_school San Francisco \n", + "594856 not_attending_school San Francisco \n", + "594859 not_attending_school San Francisco \n", + "594862 not_attending_school San Francisco \n", + "594873 not_attending_school San Francisco \n", + "594877 not_attending_school San Francisco \n", + "594894 not_attending_school San Francisco \n", + "594901 not_attending_school San Francisco \n", + "594935 not_attending_school San Francisco \n", + "594962 not_attending_school San Francisco \n", + "594972 not_attending_school San Francisco \n", + "656110 not_attending_school San Francisco \n", + "\n", + " trip_taker_person_id trip_end_time \n", + "115980 10066255028734967962 07:34:11 \n", + "116099 10066255028734967962 10:42:11 \n", + "257674 1325181746552868554 17:43:25 \n", + "257680 14409692340574959811 00:05:27 \n", + "257681 2310331066900902679 20:39:52 \n", + "257700 1325181746552868554 18:36:37 \n", + "257740 1325181746552868554 20:43:21 \n", + "257742 11058477761487230854 14:17:22 \n", + "257752 4746831412975349070 08:06:39 \n", + "257766 2310331066900902679 09:32:34 \n", + "257782 11058477761487230854 13:39:06 \n", + "319406 12894946300265742193 22:06:39 \n", + "453990 10066255028734967962 13:15:05 \n", + "454315 10066255028734967962 20:23:26 \n", + "594828 14409692340574959811 22:40:27 \n", + "594837 2310331066900902679 15:42:31 \n", + "594840 14409692340574959811 12:57:01 \n", + "594856 14409692340574959811 11:55:07 \n", + "594859 2310331066900902679 19:27:48 \n", + "594862 1325181746552868554 16:23:22 \n", + "594873 2310331066900902679 16:16:28 \n", + "594877 4746831412975349070 10:08:11 \n", + "594894 1325181746552868554 13:59:55 \n", + "594901 2310331066900902679 13:33:44 \n", + "594935 14409692340574959811 09:32:26 \n", + "594962 1325181746552868554 14:47:49 \n", + "594972 14409692340574959811 11:30:46 \n", + "656110 12894946300265742193 18:19:12 " + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4eccfdf8-429e-43df-899e-f7d77e051831", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c929c77d-0173-4a7d-be49-762349daf5cb", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ad574f5a-8780-443e-8a16-52387d0a1fb8", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "97f56b20-f299-43f5-bad4-2a42362962e2", + "metadata": {}, + "source": [ + "#### Read in Streetlight Data" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", + "metadata": {}, + "outputs": [], + "source": [ + "streetlight = \"streetlight_bay_bridge_corridor_study_corridor_study.csv\"" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data = to_snakecase(pd.read_csv(f\"{GCS_PATH}{streetlight}\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", + "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", + "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
1305Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1128174334San Francisco – Oakland Bay Bridge / 237731428...Motorway0.177yes43EASTno1: Weekday (M-F)15: 11am (11am-12noon)8505581167.7491504.041.16False66
329Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1032819756San Francisco – Oakland Bay Bridge / 11415208 / 1Motorway0.109yes220WESTno1: Weekday (M-F)29: 11pm (11pm-12am)182465768.596199.301.05False74
399Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1036056766San Francisco – Oakland Bay Bridge / 52721870 / 1Motorway0.073yes37EASTno1: Weekday (M-F)09: Peak AM (6am-10am)2421059367.2671761.561.14False70
644Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1112052563San Francisco – Oakland Bay Bridge / 236348360...Motorway0.054yes231WESTno0: All Days (M-Su)14: Mid-Day (10am-4pm)4452752369.2482387.111.34True66
208Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1022959400San Francisco – Oakland Bay Bridge / 661905446...Motorway1.939yes40EASTno0: All Days (M-Su)28: 10pm (10pm-11pm)54925512864.62710647.301.17False63
\n", + "
" + ], + "text/plain": [ + " data_periods \\\n", + "1305 Jan 01, 2022 - Dec 31, 2022 \n", + "329 Jan 01, 2022 - Dec 31, 2022 \n", + "399 Jan 01, 2022 - Dec 31, 2022 \n", + "644 Jan 01, 2022 - Dec 31, 2022 \n", + "208 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "1305 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", + "329 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", + "399 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", + "644 All Vehicles CVD Plus - StL All Vehicles Volume 1112052563 \n", + "208 All Vehicles CVD Plus - StL All Vehicles Volume 1022959400 \n", + "\n", + " zone_name road_classification \\\n", + "1305 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", + "329 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", + "399 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", + "644 San Francisco – Oakland Bay Bridge / 236348360... Motorway \n", + "208 San Francisco – Oakland Bay Bridge / 661905446... Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "1305 0.177 yes 43 \n", + "329 0.109 yes 220 \n", + "399 0.073 yes 37 \n", + "644 0.054 yes 231 \n", + "208 1.939 yes 40 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "1305 EAST no 1: Weekday (M-F) \n", + "329 WEST no 1: Weekday (M-F) \n", + "399 EAST no 1: Weekday (M-F) \n", + "644 WEST no 0: All Days (M-Su) \n", + "208 EAST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1305 15: 11am (11am-12noon) 8505 \n", + "329 29: 11pm (11pm-12am) 1824 \n", + "399 09: Peak AM (6am-10am) 24210 \n", + "644 14: Mid-Day (10am-4pm) 44527 \n", + "208 28: 10pm (10pm-11pm) 5492 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "1305 58 11 \n", + "329 65 7 \n", + "399 59 3 \n", + "644 52 3 \n", + "208 55 128 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "1305 67.749 1504.04 \n", + "329 68.596 199.30 \n", + "399 67.267 1761.56 \n", + "644 69.248 2387.11 \n", + "208 64.627 10647.30 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "1305 1.16 False 66 \n", + "329 1.05 False 74 \n", + "399 1.14 False 70 \n", + "644 1.34 True 66 \n", + "208 1.17 False 63 " + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data.sample(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "da10c3eb-31bd-437e-b546-82472d66f964", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1710" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(sl_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", + "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", + "
zone_idzone_namen
01005898592San Francisco – Oakland Bay Bridge / 8921938 / 190
11020456908San Francisco – Oakland Bay Bridge / 23874736 / 190
21022959400San Francisco – Oakland Bay Bridge / 661905446...90
31032819756San Francisco – Oakland Bay Bridge / 11415208 / 190
41036056766San Francisco – Oakland Bay Bridge / 52721870 / 190
51050419851San Francisco – Oakland Bay Bridge / 179235221...90
61093181568San Francisco – Oakland Bay Bridge / 50691047 / 190
71112052563San Francisco – Oakland Bay Bridge / 236348360...90
81112062603San Francisco – Oakland Bay Bridge / 236348361...90
91114495634I 80 / 395419317 / 190
101117259749San Francisco – Oakland Bay Bridge / 237731428...90
111118036302I 80 / 839972875 / 190
121120995048San Francisco – Oakland Bay Bridge / 497579295...90
131125811810I 80 / 839972874 / 190
141128174334San Francisco – Oakland Bay Bridge / 237731428...90
151130705657San Francisco – Oakland Bay Bridge / 52527662 / 190
161132861884I 80 / 236348365 / 190
171133975975San Francisco – Oakland Bay Bridge / 929579737...90
181135393455I 80 / 781148922 / 190
\n", + "
" + ], + "text/plain": [ + " zone_id zone_name n\n", + "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 90\n", + "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 90\n", + "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 90\n", + "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 90\n", + "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 90\n", + "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 90\n", + "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 90\n", + "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 90\n", + "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 90\n", + "9 1114495634 I 80 / 395419317 / 1 90\n", + "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 90\n", + "11 1118036302 I 80 / 839972875 / 1 90\n", + "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 90\n", + "13 1125811810 I 80 / 839972874 / 1 90\n", + "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 90\n", + "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 90\n", + "16 1132861884 I 80 / 236348365 / 1 90\n", + "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 90\n", + "18 1135393455 I 80 / 781148922 / 1 90" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data>>count(_.zone_id, _.zone_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "cd1ce590-2019-43f0-ba09-786520479ad8", + "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", + "
day_partn
000: All Day (12am-12am)3
101: 12am (12am-1am)3
202: Early AM (12am-6am)3
303: 1am (1am-2am)3
404: 2am (2am-3am)3
505: 3am (3am-4am)3
606: 4am (4am-5am)3
707: 5am (5am-6am)3
808: 6am (6am-7am)3
909: Peak AM (6am-10am)3
1010: 7am (7am-8am)3
1111: 8am (8am-9am)3
1212: 9am (9am-10am)3
1313: 10am (10am-11am)3
1414: Mid-Day (10am-4pm)3
1515: 11am (11am-12noon)3
1616: 12pm (12noon-1pm)3
1717: 1pm (1pm-2pm)3
1818: 2pm (2pm-3pm)3
1919: 3pm (3pm-4pm)3
2020: 4pm (4pm-5pm)3
2121: Peak PM (4pm-8pm)3
2222: 5pm (5pm-6pm)3
2323: 6pm (6pm-7pm)3
2424: 7pm (7pm-8pm)3
2525: 8pm (8pm-9pm)3
2626: Late PM (8pm-12am)3
2727: 9pm (9pm-10pm)3
2828: 10pm (10pm-11pm)3
2929: 11pm (11pm-12am)3
\n", + "
" + ], + "text/plain": [ + " day_part n\n", + "0 00: All Day (12am-12am) 3\n", + "1 01: 12am (12am-1am) 3\n", + "2 02: Early AM (12am-6am) 3\n", + "3 03: 1am (1am-2am) 3\n", + "4 04: 2am (2am-3am) 3\n", + "5 05: 3am (3am-4am) 3\n", + "6 06: 4am (4am-5am) 3\n", + "7 07: 5am (5am-6am) 3\n", + "8 08: 6am (6am-7am) 3\n", + "9 09: Peak AM (6am-10am) 3\n", + "10 10: 7am (7am-8am) 3\n", + "11 11: 8am (8am-9am) 3\n", + "12 12: 9am (9am-10am) 3\n", + "13 13: 10am (10am-11am) 3\n", + "14 14: Mid-Day (10am-4pm) 3\n", + "15 15: 11am (11am-12noon) 3\n", + "16 16: 12pm (12noon-1pm) 3\n", + "17 17: 1pm (1pm-2pm) 3\n", + "18 18: 2pm (2pm-3pm) 3\n", + "19 19: 3pm (3pm-4pm) 3\n", + "20 20: 4pm (4pm-5pm) 3\n", + "21 21: Peak PM (4pm-8pm) 3\n", + "22 22: 5pm (5pm-6pm) 3\n", + "23 23: 6pm (6pm-7pm) 3\n", + "24 24: 7pm (7pm-8pm) 3\n", + "25 25: 8pm (8pm-9pm) 3\n", + "26 26: Late PM (8pm-12am) 3\n", + "27 27: 9pm (9pm-10pm) 3\n", + "28 28: 10pm (10pm-11pm) 3\n", + "29 29: 11pm (11pm-12am) 3" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data>>filter(_.zone_id==1133975975)>>count(_.day_part)" + ] + }, + { + "cell_type": "markdown", + "id": "5d362f46-cfe6-4d13-b3ea-67f491a66897", + "metadata": {}, + "source": [ + "* The data here shows that each segment is broken out into hour time slots and then also aggregated to peak time periods. moving forward we will look at the `All Day` for `day_part` and `All Days` for `day_type`" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "57c890a6-c667-4917-a090-b85f1aadcad7", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data = sl_data>>filter(_.day_part == '00: All Day (12am-12am)', _.day_type == '0: All Days (M-Su)')" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "0a059c82-c7c8-43b9-92a6-178b42101828", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "19" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(sl_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "67213733-9905-42bd-912e-cf943cd66b40", + "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", + "
zone_idzone_namen
01005898592San Francisco – Oakland Bay Bridge / 8921938 / 11
11020456908San Francisco – Oakland Bay Bridge / 23874736 / 11
21022959400San Francisco – Oakland Bay Bridge / 661905446...1
31032819756San Francisco – Oakland Bay Bridge / 11415208 / 11
41036056766San Francisco – Oakland Bay Bridge / 52721870 / 11
51050419851San Francisco – Oakland Bay Bridge / 179235221...1
61093181568San Francisco – Oakland Bay Bridge / 50691047 / 11
71112052563San Francisco – Oakland Bay Bridge / 236348360...1
81112062603San Francisco – Oakland Bay Bridge / 236348361...1
91114495634I 80 / 395419317 / 11
101117259749San Francisco – Oakland Bay Bridge / 237731428...1
111118036302I 80 / 839972875 / 11
121120995048San Francisco – Oakland Bay Bridge / 497579295...1
131125811810I 80 / 839972874 / 11
141128174334San Francisco – Oakland Bay Bridge / 237731428...1
151130705657San Francisco – Oakland Bay Bridge / 52527662 / 11
161132861884I 80 / 236348365 / 11
171133975975San Francisco – Oakland Bay Bridge / 929579737...1
181135393455I 80 / 781148922 / 11
\n", + "
" + ], + "text/plain": [ + " zone_id zone_name n\n", + "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 1\n", + "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 1\n", + "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 1\n", + "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 1\n", + "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 1\n", + "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 1\n", + "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 1\n", + "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 1\n", + "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 1\n", + "9 1114495634 I 80 / 395419317 / 1 1\n", + "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 1\n", + "11 1118036302 I 80 / 839972875 / 1 1\n", + "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 1\n", + "13 1125811810 I 80 / 839972874 / 1 1\n", + "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 1\n", + "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 1\n", + "16 1132861884 I 80 / 236348365 / 1 1\n", + "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 1\n", + "18 1135393455 I 80 / 781148922 / 1 1" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data>>count(_.zone_id, _.zone_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", + "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", + "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
1530Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1133975975San Francisco – Oakland Bay Bridge / 929579737...Motorway0.273yes215WESTno0: All Days (M-Su)00: All Day (12am-12am)128139492368.63435038.31.39True67
\n", + "
" + ], + "text/plain": [ + " data_periods \\\n", + "1530 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "1530 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", + "\n", + " zone_name road_classification \\\n", + "1530 San Francisco – Oakland Bay Bridge / 929579737... Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "1530 0.273 yes 215 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "1530 WEST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1530 00: All Day (12am-12am) 128139 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "1530 49 23 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "1530 68.634 35038.3 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "1530 1.39 True 67 " + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data>>filter(_.zone_id==1133975975)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "07213453-aa88-4037-ad63-f2eb0454c516", + "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" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From a592e83d7a104e8a72a1e5275671e07f7d1ca3fc Mon Sep 17 00:00:00 2001 From: natam1 Date: Tue, 19 Mar 2024 07:48:02 +0000 Subject: [PATCH 02/16] add initial exploratory analysis for Streetlight and Replica data exports --- .../corridor_study/data_downloads.ipynb | 7416 +++++++++++------ 1 file changed, 4676 insertions(+), 2740 deletions(-) diff --git a/sb125_analyses/corridor_study/data_downloads.ipynb b/sb125_analyses/corridor_study/data_downloads.ipynb index d903beaa5..8dbc1e8a4 100644 --- a/sb125_analyses/corridor_study/data_downloads.ipynb +++ b/sb125_analyses/corridor_study/data_downloads.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 117, "id": "45233485-2055-499a-a89e-fc154fd56e63", "metadata": {}, "outputs": [], @@ -19,7 +19,10 @@ "import pandas as pd\n", "from siuba import *\n", "\n", - "from calitp_data_analysis.sql import to_snakecase" + "from calitp_data_analysis.sql import to_snakecase\n", + "\n", + "import altair as alt\n", + "from calitp_data_analysis import calitp_color_palette as cp\n" ] }, { @@ -47,7 +50,7 @@ "id": "71c1deda-8e83-45d8-a0f5-20b36b7051c0", "metadata": {}, "source": [ - "#### Read in Replica Data" + "### Read in Replica Data Spring 2023" ] }, { @@ -70,7 +73,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_156/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_339/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))\n" ] } @@ -162,438 +165,438 @@ " \n", " \n", " \n", - " 316049\n", - " single_family\n", + " 267500\n", + " multi_family\n", " 53\n", " english\n", - " 327 (San Francisco, CA)\n", - " 9141816078114771967\n", + " 302.01 (San Francisco, CA)\n", + " 2981999124390393386\n", " male\n", - " 7 (Tract 327, San Francisco, CA)\n", + " 3 (Tract 302.01, San Francisco, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " two_races_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 69.0\n", - " 13927635906260089585\n", - " 1 (Tract 4287, Alameda, CA)\n", + " 27.0\n", + " 16597255654725327963\n", + " 1 (Tract 4222, Alameda, CA)\n", " single_family\n", - " unemployed_under_16_not_in_labor_force\n", + " employed_not_working\n", " California\n", " Alameda\n", - " Does not have work/school location\n", - " 4287 (Alameda, CA)\n", - " 0.0\n", - " 7 (Tract 327, San Francisco, CA)\n", - " other_travel_mode\n", - " two\n", + " 3 (Tract 302.01, San Francisco, CA)\n", + " 4222 (Alameda, CA)\n", + " 284387.0\n", + " 3 (Tract 302.01, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", " auto_passenger\n", " home\n", " single_family\n", " NaN\n", - " Does not have work/school location\n", - " 1.0\n", + " California\n", + " 3.0\n", " San Francisco\n", " single_family\n", " not_working\n", - " owner\n", + " renter\n", " unknown_fuel_type\n", - " 327 (San Francisco, CA)\n", - " Does not have work/school location\n", - " advanced_degree\n", - " 05:42:00\n", - " 0.0\n", - " not_in_labor_force\n", - " work\n", - " single_family\n", - " Does not have work/school location\n", - " 24.1\n", + " 302.01 (San Francisco, CA)\n", + " 302.01 (San Francisco, CA)\n", + " bachelors_degree\n", + " 08:04:00\n", + " 94781.0\n", + " employed\n", + " school\n", + " multi_family\n", + " San Francisco\n", + " 21.4\n", " not_attending_school\n", " San Francisco\n", - " 18329131915304783635\n", - " 06:35:44\n", + " 114523536752271314\n", + " 08:57:16\n", " \n", " \n", - " 589366\n", - " multi_family\n", - " 29\n", - " english\n", - " 6041.03 (San Mateo, CA)\n", - " 9632183769534570447\n", - " female\n", - " 2 (Tract 6041.03, San Mateo, CA)\n", + " 318811\n", + " education\n", + " 51\n", + " GQ_language\n", + " 179.03 (San Francisco, CA)\n", + " 294769040967747866\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " hispanic_or_latino_origin\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 46.0\n", - " 7705858213998213664\n", - " 3 (Tract 4012, Alameda, CA)\n", - " non_retail_attraction\n", - " remote\n", + " 19.0\n", + " 7487019993558144384\n", + " 2 (Tract 3131.04, Contra Costa, CA)\n", + " office\n", + " unemployed_under_16_not_in_labor_force\n", " California\n", - " Alameda\n", - " 3 (Tract 6024, San Mateo, CA)\n", - " 4012 (Alameda, CA)\n", - " 83424.0\n", - " 2 (Tract 6041.03, San Mateo, CA)\n", - " worked_from_home\n", - " one\n", - " auto_passenger\n", - " work_from_home\n", - " multiple_units\n", + " Contra Costa\n", + " Does not have work/school location\n", + " 3131.04 (Contra Costa, CA)\n", + " 0.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " other_travel_mode\n", + " unknown_num_vehicles\n", + " private_auto\n", + " home\n", + " GQ_structure\n", " NaN\n", - " California\n", + " Does not have work/school location\n", " 1.0\n", - " San Mateo\n", - " mixed_use\n", - " naics621492\n", - " renter\n", - " unknown_fuel_type\n", - " 6041.03 (San Mateo, CA)\n", - " 6024 (San Mateo, CA)\n", - " some_college\n", - " 10:44:00\n", - " 83424.0\n", - " employed\n", - " recreation\n", - " multi_family\n", - " San Mateo\n", - " 22.6\n", + " San Francisco\n", + " office\n", + " not_working\n", + " GQ\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " Does not have work/school location\n", + " high_school\n", + " 14:07:00\n", + " 0.0\n", + " not_in_labor_force\n", + " maintenance\n", + " education\n", + " Does not have work/school location\n", + " 35.2\n", " not_attending_school\n", - " San Mateo\n", - " 2062283279317414522\n", - " 11:13:30\n", + " San Francisco\n", + " 6449342572168120247\n", + " 14:58:48\n", " \n", " \n", - " 248983\n", - " single_family\n", - " 59\n", + " 127266\n", + " multi_family\n", + " 183\n", " english\n", - " 6038.02 (San Mateo, CA)\n", - " 11049592624520655437\n", + " 102.01 (San Francisco, CA)\n", + " 2007494479315805918\n", " female\n", - " 1 (Tract 6038.02, San Mateo, CA)\n", + " 2 (Tract 102.01, San Francisco, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " hispanic_or_latino_origin\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 51.0\n", - " 9727666906861881478\n", - " 2 (Tract 3580, Contra Costa, CA)\n", + " 28.0\n", + " 14874947884140784827\n", + " 2 (Tract 12.09, Nevada, CA)\n", " retail\n", - " remote\n", + " employed_not_working\n", " California\n", - " Contra Costa\n", - " 1 (Tract 6038.02, San Mateo, CA)\n", - " 3580 (Contra Costa, CA)\n", - " 207015.0\n", - " 1 (Tract 6038.02, San Mateo, CA)\n", - " worked_from_home\n", - " three_plus\n", + " Nevada\n", + " 1 (Tract 2014.01, Napa, CA)\n", + " 12.09 (Nevada, CA)\n", + " 327465.0\n", + " 2 (Tract 102.01, San Francisco, CA)\n", " private_auto\n", + " three_plus\n", + " auto_passenger\n", " home\n", - " single_family\n", + " multiple_units\n", " NaN\n", " California\n", " 3.0\n", - " San Mateo\n", + " San Francisco\n", " retail\n", - " naics62\n", - " owner\n", - " other_non_bev\n", - " 6038.02 (San Mateo, CA)\n", - " 6038.02 (San Mateo, CA)\n", - " some_college\n", - " 18:24:00\n", - " 85484.0\n", + " naics3399\n", + " renter\n", + " unknown_fuel_type\n", + " 102.01 (San Francisco, CA)\n", + " 2014.01 (Napa, CA)\n", + " bachelors_degree\n", + " 09:02:00\n", + " 111762.0\n", " employed\n", " shop\n", - " single_family\n", - " San Mateo\n", - " 38.6\n", + " multi_family\n", + " Napa\n", + " 185.6\n", " not_attending_school\n", - " San Mateo\n", - " 4488848831358882611\n", - " 19:23:48\n", + " San Francisco\n", + " 15665869551117189445\n", + " 12:05:47\n", " \n", " \n", - " 18698\n", + " 309112\n", " retail\n", - " 31\n", - " NaN\n", - " 110.02 (San Francisco, CA)\n", - " \n", - " NaN\n", - " Visitor (no home location)\n", + " 28\n", + " spanish\n", + " 6022.02 (San Mateo, CA)\n", + " 12449373272305106079\n", + " male\n", + " 2 (Tract 3810, Contra Costa, CA)\n", " California\n", - " Visitor (no home location)\n", - " NaN\n", + " California\n", + " hispanic_or_latino_origin\n", " NaN\n", " NaN\n", - " visitor\n", + " core\n", " unknown_vehicle_type\n", - " NaN\n", - " 6990046985316847809\n", - " 1 (Tract 4230, Alameda, CA)\n", - " retail\n", - " NaN\n", + " 26.0\n", + " 12179224938804524534\n", + " 2 (Tract 3810, Contra Costa, CA)\n", + " multi_family\n", + " unemployed_under_16_not_in_labor_force\n", " California\n", - " Alameda\n", - " Visitor (no work/school location)\n", - " 4230 (Alameda, CA)\n", - " NaN\n", - " 1 (Tract 110.02, San Francisco, CA)\n", - " NaN\n", - " NaN\n", + " Contra Costa\n", + " Does not have work/school location\n", + " 3810 (Contra Costa, CA)\n", + " 0.0\n", + " 1 (Tract 6022.02, San Mateo, CA)\n", + " other_travel_mode\n", + " three_plus\n", " auto_passenger\n", - " shop\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " San Francisco\n", - " mixed_use\n", - " NaN\n", + " work\n", + " several_units\n", " NaN\n", + " Does not have work/school location\n", + " 2.0\n", + " San Mateo\n", + " multi_family\n", + " not_working\n", + " renter\n", " unknown_fuel_type\n", - " Visitor (no home location)\n", - " Visitor (no work/school location)\n", - " NaN\n", - " 17:31:08\n", - " NaN\n", - " NaN\n", - " eat\n", - " mixed_use\n", - " Visitor (no work/school location)\n", - " 13.1\n", - " NaN\n", - " Visitor (no home location)\n", - " 17236301087899708165\n", - " 18:02:42\n", + " 3810 (Contra Costa, CA)\n", + " Does not have work/school location\n", + " some_college\n", + " 10:27:00\n", + " 0.0\n", + " not_in_labor_force\n", + " home\n", + " retail\n", + " Does not have work/school location\n", + " 24.2\n", + " not_attending_school\n", + " Contra Costa\n", + " 2304317130050975816\n", + " 10:55:45\n", " \n", " \n", - " 505861\n", - " non_retail_attraction\n", - " 45\n", - " english\n", - " 615.07 (San Francisco, CA)\n", - " 1615955340221599382\n", + " 199784\n", + " single_family\n", + " 48\n", + " indo_european\n", + " 4507.51 (Alameda, CA)\n", + " 14382520070638101596\n", " female\n", - " 1 (Tract 3521.02, Contra Costa, CA)\n", + " 2 (Tract 4507.51, Alameda, CA)\n", " California\n", " California\n", - " white_not_hispanic_or_latino\n", + " asian_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 75.0\n", - " 88254748792768887\n", - " 1 (Tract 3521.02, Contra Costa, CA)\n", - " single_family\n", + " 37.0\n", + " 1929327997623174538\n", + " 1 (Tract 615.01, San Francisco, CA)\n", + " retail\n", " in_person\n", " California\n", - " Contra Costa\n", - " 1 (Tract 615.07, San Francisco, CA)\n", - " 3521.02 (Contra Costa, CA)\n", - " 509711.0\n", - " 1 (Tract 615.07, San Francisco, CA)\n", - " auto_passenger\n", + " San Francisco\n", + " 1 (Tract 615.01, San Francisco, CA)\n", + " 615.01 (San Francisco, CA)\n", + " 198942.0\n", + " 2 (Tract 4507.51, Alameda, CA)\n", + " public_transit\n", " two\n", " auto_passenger\n", - " work\n", + " home\n", " single_family\n", " NaN\n", " California\n", - " 2.0\n", - " San Francisco\n", - " single_family\n", - " naics56\n", + " 4.0\n", + " Alameda\n", + " retail\n", + " naics5151\n", " owner\n", " unknown_fuel_type\n", - " 3521.02 (Contra Costa, CA)\n", - " 615.07 (San Francisco, CA)\n", - " some_college\n", - " 16:39:00\n", - " 12874.0\n", + " 4507.51 (Alameda, CA)\n", + " 615.01 (San Francisco, CA)\n", + " advanced_degree\n", + " 08:50:00\n", + " 34978.0\n", " employed\n", - " home\n", - " non_retail_attraction\n", + " work\n", + " single_family\n", " San Francisco\n", - " 21.8\n", + " 37.6\n", " not_attending_school\n", - " Contra Costa\n", - " 14267323924031043284\n", - " 17:24:46\n", + " Alameda\n", + " 11256368651162751791\n", + " 09:38:25\n", " \n", " \n", "\n", "" ], "text/plain": [ - " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "316049 single_family 53 english \n", - "589366 multi_family 29 english \n", - "248983 single_family 59 english \n", - "18698 retail 31 NaN \n", - "505861 non_retail_attraction 45 english \n", + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "267500 multi_family 53 english \n", + "318811 education 51 GQ_language \n", + "127266 multi_family 183 english \n", + "309112 retail 28 spanish \n", + "199784 single_family 48 indo_european \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "316049 327 (San Francisco, CA) 9141816078114771967 male \n", - "589366 6041.03 (San Mateo, CA) 9632183769534570447 female \n", - "248983 6038.02 (San Mateo, CA) 11049592624520655437 female \n", - "18698 110.02 (San Francisco, CA) NaN \n", - "505861 615.07 (San Francisco, CA) 1615955340221599382 female \n", + "267500 302.01 (San Francisco, CA) 2981999124390393386 male \n", + "318811 179.03 (San Francisco, CA) 294769040967747866 male \n", + "127266 102.01 (San Francisco, CA) 2007494479315805918 female \n", + "309112 6022.02 (San Mateo, CA) 12449373272305106079 male \n", + "199784 4507.51 (Alameda, CA) 14382520070638101596 female \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "316049 7 (Tract 327, San Francisco, CA) California \n", - "589366 2 (Tract 6041.03, San Mateo, CA) California \n", - "248983 1 (Tract 6038.02, San Mateo, CA) California \n", - "18698 Visitor (no home location) California \n", - "505861 1 (Tract 3521.02, Contra Costa, CA) California \n", - "\n", - " trip_taker_home_st_2020 trip_taker_race_ethnicity \\\n", - "316049 California asian_not_hispanic_or_latino \n", - "589366 California asian_not_hispanic_or_latino \n", - "248983 California asian_not_hispanic_or_latino \n", - "18698 Visitor (no home location) NaN \n", - "505861 California white_not_hispanic_or_latino \n", + "267500 3 (Tract 302.01, San Francisco, CA) California \n", + "318811 1 (Tract 179.03, San Francisco, CA) California \n", + "127266 2 (Tract 102.01, San Francisco, CA) California \n", + "309112 2 (Tract 3810, Contra Costa, CA) California \n", + "199784 2 (Tract 4507.51, Alameda, CA) California \n", + "\n", + " trip_taker_home_st_2020 trip_taker_race_ethnicity \\\n", + "267500 California two_races_not_hispanic_or_latino \n", + "318811 California hispanic_or_latino_origin \n", + "127266 California hispanic_or_latino_origin \n", + "309112 California hispanic_or_latino_origin \n", + "199784 California asian_not_hispanic_or_latino \n", "\n", " transit_agency transit_route trip_taker_resident_type \\\n", - "316049 NaN NaN core \n", - "589366 NaN NaN core \n", - "248983 NaN NaN core \n", - "18698 NaN NaN visitor \n", - "505861 NaN NaN core \n", + "267500 NaN NaN core \n", + "318811 NaN NaN core \n", + "127266 NaN NaN core \n", + "309112 NaN NaN core \n", + "199784 NaN NaN core \n", "\n", " vehicle_type trip_taker_age activity_id \\\n", - "316049 unknown_vehicle_type 69.0 13927635906260089585 \n", - "589366 unknown_vehicle_type 46.0 7705858213998213664 \n", - "248983 unknown_vehicle_type 51.0 9727666906861881478 \n", - "18698 unknown_vehicle_type NaN 6990046985316847809 \n", - "505861 unknown_vehicle_type 75.0 88254748792768887 \n", + "267500 unknown_vehicle_type 27.0 16597255654725327963 \n", + "318811 unknown_vehicle_type 19.0 7487019993558144384 \n", + "127266 unknown_vehicle_type 28.0 14874947884140784827 \n", + "309112 unknown_vehicle_type 26.0 12179224938804524534 \n", + "199784 unknown_vehicle_type 37.0 1929327997623174538 \n", "\n", " destination_bgrp_2020 destination_building_use \\\n", - "316049 1 (Tract 4287, Alameda, CA) single_family \n", - "589366 3 (Tract 4012, Alameda, CA) non_retail_attraction \n", - "248983 2 (Tract 3580, Contra Costa, CA) retail \n", - "18698 1 (Tract 4230, Alameda, CA) retail \n", - "505861 1 (Tract 3521.02, Contra Costa, CA) single_family \n", + "267500 1 (Tract 4222, Alameda, CA) single_family \n", + "318811 2 (Tract 3131.04, Contra Costa, CA) office \n", + "127266 2 (Tract 12.09, Nevada, CA) retail \n", + "309112 2 (Tract 3810, Contra Costa, CA) multi_family \n", + "199784 1 (Tract 615.01, San Francisco, CA) retail \n", "\n", " trip_taker_wfh destination_st_2020 \\\n", - "316049 unemployed_under_16_not_in_labor_force California \n", - "589366 remote California \n", - "248983 remote California \n", - "18698 NaN California \n", - "505861 in_person California \n", + "267500 employed_not_working California \n", + "318811 unemployed_under_16_not_in_labor_force California \n", + "127266 employed_not_working California \n", + "309112 unemployed_under_16_not_in_labor_force California \n", + "199784 in_person California \n", "\n", " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", - "316049 Alameda Does not have work/school location \n", - "589366 Alameda 3 (Tract 6024, San Mateo, CA) \n", - "248983 Contra Costa 1 (Tract 6038.02, San Mateo, CA) \n", - "18698 Alameda Visitor (no work/school location) \n", - "505861 Contra Costa 1 (Tract 615.07, San Francisco, CA) \n", + "267500 Alameda 3 (Tract 302.01, San Francisco, CA) \n", + "318811 Contra Costa Does not have work/school location \n", + "127266 Nevada 1 (Tract 2014.01, Napa, CA) \n", + "309112 Contra Costa Does not have work/school location \n", + "199784 San Francisco 1 (Tract 615.01, San Francisco, CA) \n", "\n", " destination_trct_2020 trip_taker_household_income \\\n", - "316049 4287 (Alameda, CA) 0.0 \n", - "589366 4012 (Alameda, CA) 83424.0 \n", - "248983 3580 (Contra Costa, CA) 207015.0 \n", - "18698 4230 (Alameda, CA) NaN \n", - "505861 3521.02 (Contra Costa, CA) 509711.0 \n", + "267500 4222 (Alameda, CA) 284387.0 \n", + "318811 3131.04 (Contra Costa, CA) 0.0 \n", + "127266 12.09 (Nevada, CA) 327465.0 \n", + "309112 3810 (Contra Costa, CA) 0.0 \n", + "199784 615.01 (San Francisco, CA) 198942.0 \n", "\n", " origin_bgrp_2020 trip_taker_commute_mode \\\n", - "316049 7 (Tract 327, San Francisco, CA) other_travel_mode \n", - "589366 2 (Tract 6041.03, San Mateo, CA) worked_from_home \n", - "248983 1 (Tract 6038.02, San Mateo, CA) worked_from_home \n", - "18698 1 (Tract 110.02, San Francisco, CA) NaN \n", - "505861 1 (Tract 615.07, San Francisco, CA) auto_passenger \n", + "267500 3 (Tract 302.01, San Francisco, CA) worked_from_home \n", + "318811 1 (Tract 179.03, San Francisco, CA) other_travel_mode \n", + "127266 2 (Tract 102.01, San Francisco, CA) private_auto \n", + "309112 1 (Tract 6022.02, San Mateo, CA) other_travel_mode \n", + "199784 2 (Tract 4507.51, Alameda, CA) public_transit \n", "\n", " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", - "316049 two auto_passenger home \n", - "589366 one auto_passenger work_from_home \n", - "248983 three_plus private_auto home \n", - "18698 NaN auto_passenger shop \n", - "505861 two auto_passenger work \n", + "267500 three_plus auto_passenger home \n", + "318811 unknown_num_vehicles private_auto home \n", + "127266 three_plus auto_passenger home \n", + "309112 three_plus auto_passenger work \n", + "199784 two auto_passenger home \n", "\n", " trip_taker_building_type transit_submode \\\n", - "316049 single_family NaN \n", - "589366 multiple_units NaN \n", - "248983 single_family NaN \n", - "18698 NaN NaN \n", - "505861 single_family NaN \n", + "267500 single_family NaN \n", + "318811 GQ_structure NaN \n", + "127266 multiple_units NaN \n", + "309112 several_units NaN \n", + "199784 single_family NaN \n", "\n", " trip_taker_work_st_2020 trip_taker_household_size \\\n", - "316049 Does not have work/school location 1.0 \n", - "589366 California 1.0 \n", - "248983 California 3.0 \n", - "18698 Visitor (no work/school location) NaN \n", - "505861 California 2.0 \n", + "267500 California 3.0 \n", + "318811 Does not have work/school location 1.0 \n", + "127266 California 3.0 \n", + "309112 Does not have work/school location 2.0 \n", + "199784 California 4.0 \n", "\n", " origin_cty_2020 destination_land_use trip_taker_industry \\\n", - "316049 San Francisco single_family not_working \n", - "589366 San Mateo mixed_use naics621492 \n", - "248983 San Mateo retail naics62 \n", - "18698 San Francisco mixed_use NaN \n", - "505861 San Francisco single_family naics56 \n", + "267500 San Francisco single_family not_working \n", + "318811 San Francisco office not_working \n", + "127266 San Francisco retail naics3399 \n", + "309112 San Mateo multi_family not_working \n", + "199784 Alameda retail naics5151 \n", "\n", " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "316049 owner unknown_fuel_type 327 (San Francisco, CA) \n", - "589366 renter unknown_fuel_type 6041.03 (San Mateo, CA) \n", - "248983 owner other_non_bev 6038.02 (San Mateo, CA) \n", - "18698 NaN unknown_fuel_type Visitor (no home location) \n", - "505861 owner unknown_fuel_type 3521.02 (Contra Costa, CA) \n", + "267500 renter unknown_fuel_type 302.01 (San Francisco, CA) \n", + "318811 GQ other_non_bev 179.03 (San Francisco, CA) \n", + "127266 renter unknown_fuel_type 102.01 (San Francisco, CA) \n", + "309112 renter unknown_fuel_type 3810 (Contra Costa, CA) \n", + "199784 owner unknown_fuel_type 4507.51 (Alameda, CA) \n", "\n", " trip_taker_work_trct_2020 trip_taker_education \\\n", - "316049 Does not have work/school location advanced_degree \n", - "589366 6024 (San Mateo, CA) some_college \n", - "248983 6038.02 (San Mateo, CA) some_college \n", - "18698 Visitor (no work/school location) NaN \n", - "505861 615.07 (San Francisco, CA) some_college \n", + "267500 302.01 (San Francisco, CA) bachelors_degree \n", + "318811 Does not have work/school location high_school \n", + "127266 2014.01 (Napa, CA) bachelors_degree \n", + "309112 Does not have work/school location some_college \n", + "199784 615.01 (San Francisco, CA) advanced_degree \n", "\n", " trip_start_time trip_taker_individual_income \\\n", - "316049 05:42:00 0.0 \n", - "589366 10:44:00 83424.0 \n", - "248983 18:24:00 85484.0 \n", - "18698 17:31:08 NaN \n", - "505861 16:39:00 12874.0 \n", - "\n", - " trip_taker_employment_status trip_purpose origin_land_use \\\n", - "316049 not_in_labor_force work single_family \n", - "589366 employed recreation multi_family \n", - "248983 employed shop single_family \n", - "18698 NaN eat mixed_use \n", - "505861 employed home non_retail_attraction \n", + "267500 08:04:00 94781.0 \n", + "318811 14:07:00 0.0 \n", + "127266 09:02:00 111762.0 \n", + "309112 10:27:00 0.0 \n", + "199784 08:50:00 34978.0 \n", + "\n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "267500 employed school multi_family \n", + "318811 not_in_labor_force maintenance education \n", + "127266 employed shop multi_family \n", + "309112 not_in_labor_force home retail \n", + "199784 employed work single_family \n", "\n", " trip_taker_work_cty_2020 trip_distance_miles \\\n", - "316049 Does not have work/school location 24.1 \n", - "589366 San Mateo 22.6 \n", - "248983 San Mateo 38.6 \n", - "18698 Visitor (no work/school location) 13.1 \n", - "505861 San Francisco 21.8 \n", - "\n", - " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", - "316049 not_attending_school San Francisco \n", - "589366 not_attending_school San Mateo \n", - "248983 not_attending_school San Mateo \n", - "18698 NaN Visitor (no home location) \n", - "505861 not_attending_school Contra Costa \n", + "267500 San Francisco 21.4 \n", + "318811 Does not have work/school location 35.2 \n", + "127266 Napa 185.6 \n", + "309112 Does not have work/school location 24.2 \n", + "199784 San Francisco 37.6 \n", + "\n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "267500 not_attending_school San Francisco \n", + "318811 not_attending_school San Francisco \n", + "127266 not_attending_school San Francisco \n", + "309112 not_attending_school Contra Costa \n", + "199784 not_attending_school Alameda \n", "\n", " trip_taker_person_id trip_end_time \n", - "316049 18329131915304783635 06:35:44 \n", - "589366 2062283279317414522 11:13:30 \n", - "248983 4488848831358882611 19:23:48 \n", - "18698 17236301087899708165 18:02:42 \n", - "505861 14267323924031043284 17:24:46 " + "267500 114523536752271314 08:57:16 \n", + "318811 6449342572168120247 14:58:48 \n", + "127266 15665869551117189445 12:05:47 \n", + "309112 2304317130050975816 10:55:45 \n", + "199784 11256368651162751791 09:38:25 " ] }, "execution_count": 6, @@ -607,147 +610,551 @@ }, { "cell_type": "code", - "execution_count": 7, - "id": "af5533aa-8e0e-43e9-bcef-85a3ec252e8e", + "execution_count": 148, + "id": "1f3e4cbb-d211-40b1-b4bb-2c7cb43b33a9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "674864" + "Index(['origin_building_use', 'trip_duration_minutes', 'trip_taker_language',\n", + " 'origin_trct_2020', 'trip_taker_household_id', 'trip_taker_sex',\n", + " 'trip_taker_home_bgrp_2020', 'origin_st_2020',\n", + " 'trip_taker_home_st_2020', 'trip_taker_race_ethnicity',\n", + " 'transit_agency', 'transit_route', 'trip_taker_resident_type',\n", + " 'vehicle_type', 'trip_taker_age', 'activity_id',\n", + " 'destination_bgrp_2020', 'destination_building_use', 'trip_taker_wfh',\n", + " 'destination_st_2020', 'destination_cty_2020',\n", + " 'trip_taker_work_bgrp_2020', 'destination_trct_2020',\n", + " 'trip_taker_household_income', 'origin_bgrp_2020',\n", + " 'trip_taker_commute_mode', 'trip_taker_available_vehicles',\n", + " 'primary_mode', 'previous_trip_purpose', 'trip_taker_building_type',\n", + " 'transit_submode', 'trip_taker_work_st_2020',\n", + " 'trip_taker_household_size', 'origin_cty_2020', 'destination_land_use',\n", + " 'trip_taker_industry', 'trip_taker_tenure', 'vehicle_fuel_type',\n", + " 'trip_taker_home_trct_2020', 'trip_taker_work_trct_2020',\n", + " 'trip_taker_education', 'trip_start_time',\n", + " 'trip_taker_individual_income', 'trip_taker_employment_status',\n", + " 'trip_purpose', 'origin_land_use', 'trip_taker_work_cty_2020',\n", + " 'trip_distance_miles', 'trip_taker_school_grade_attending',\n", + " 'trip_taker_home_cty_2020', 'trip_taker_person_id', 'trip_end_time'],\n", + " dtype='object')" ] }, - "execution_count": 7, + "execution_count": 148, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "len(r_trips)" + "r_trips.columns" ] }, { "cell_type": "code", - "execution_count": 30, - "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", + "execution_count": null, + "id": "e60fb5c7-a04b-48f3-8282-ca98a54dadd2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "92f9a5f4-08f1-43fc-ae01-c6bd404891d6", + "metadata": { + "tags": [] + }, + "source": [ + "#### Data Exploration: Replica\n", + "* Summarizing the data that we exported from Replica\n", + "* Existing visualizations in replica: \n", + " * Primary Mode\n", + " * Trip Purpose\n", + " * Starting hour \n", + " * Trip Duration/Distance\n", + " * Origin Destination\n", + " * Vehicle Fuel type\n", + " * Transit Routes/Stops/Sub mode/Agency\n", + " * Household Income\n", + " * Race and Ethnicity\n", + " * Private Auto Availability\n", + " * Age\n", + " * Employment/School Status\n", + " \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 138, + "id": "d7f3b44a-cd77-42e9-b0d8-7b9d228b37d5", + "metadata": {}, + "outputs": [], + "source": [ + "trips = r_trips>>group_by(_.primary_mode)>>summarize(avg_trip_time = _.trip_duration_minutes.mean(),\n", + " number_trips = _.activity_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 140, + "id": "05893215-e993-44dc-9c4b-1aa7d94815cd", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", - "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 140, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trips)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"avg_trip_time\"),\n", + " color=alt.Color(\"avg_trip_time\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 141, + "id": "65681a29-7f1b-42ed-9e0e-371a84a29cbd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 141, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trips)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"number_trips\"),\n", + " color=alt.Color(\"number_trips\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4f98abae-ae6b-4b4e-9427-b606a557582f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "674864" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(r_trips)" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "27c00872-5880-4464-84a5-e91423ce7895", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "
trip_taker_household_idn
\n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + "
number_trips
24868627897
262322NaN16384
110604819421956364075181528
82299609777131291778859627
74914555246788117181473022
.........
26231299884893668902201881
26231699913423094393305601
262317999249090342986666510674864
26231899925996610099430061
\n", + "
" + ], + "text/plain": [ + " number_trips\n", + "0 674864" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>summarize(number_trips = _.activity_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "2def0aaf-9182-4393-8049-2dfb95749585", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
number_trips
262319999358848369451915210309596
\n", - "

262323 rows × 2 columns

\n", "
" ], "text/plain": [ - " trip_taker_household_id n\n", - "248686 27897\n", - "262322 NaN 16384\n", - "110604 8194219563640751815 28\n", - "82299 6097771312917788596 27\n", - "74914 5552467881171814730 22\n", - "... ... ...\n", - "262312 9988489366890220188 1\n", - "262316 9991342309439330560 1\n", - "262317 9992490903429866665 1\n", - "262318 9992599661009943006 1\n", - "262319 9993588483694519152 1\n", + " number_trips\n", + "0 309596" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>summarize(number_trips = _.trip_taker_person_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "id": "47fecd22-8276-48b8-9c74-d3a94906bbae", + "metadata": {}, + "outputs": [], + "source": [ + "race_ethnicity_by_mode = r_trips>>group_by(_.primary_mode)>>count(_.trip_taker_race_ethnicity)" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "id": "5e895499-2142-432d-8402-c035f81326b6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ "\n", - "[262323 rows x 2 columns]" + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" ] }, - "execution_count": 30, + "execution_count": 116, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "r_trips>>count(_.trip_taker_household_id)>>arrange(-_.n)" + "chart = (\n", + " alt.Chart(race_ethnicity_by_mode)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"n\"),\n", + " color=alt.Color(\"trip_taker_race_ethnicity\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " ] }, { "cell_type": "code", - "execution_count": 32, - "id": "34f3079c-34b8-41e6-be02-ade8f229926a", + "execution_count": null, + "id": "da3bbe59-9b06-471f-beb1-4762b8939600", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d8cd6354-0433-4134-ad6e-9df92122cbd2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 144, + "id": "261d7f48-f7c3-4ea7-a526-6f813ca16ede", "metadata": {}, "outputs": [ { @@ -771,1299 +1178,545 @@ " \n", " \n", " \n", - " origin_building_use\n", - " trip_duration_minutes\n", - " trip_taker_language\n", - " origin_trct_2020\n", - " trip_taker_household_id\n", - " trip_taker_sex\n", - " trip_taker_home_bgrp_2020\n", - " origin_st_2020\n", - " trip_taker_home_st_2020\n", - " trip_taker_race_ethnicity\n", - " transit_agency\n", - " transit_route\n", - " trip_taker_resident_type\n", - " vehicle_type\n", - " trip_taker_age\n", - " activity_id\n", - " destination_bgrp_2020\n", - " destination_building_use\n", - " trip_taker_wfh\n", - " destination_st_2020\n", - " destination_cty_2020\n", - " trip_taker_work_bgrp_2020\n", - " destination_trct_2020\n", - " trip_taker_household_income\n", - " origin_bgrp_2020\n", - " trip_taker_commute_mode\n", - " trip_taker_available_vehicles\n", " primary_mode\n", - " previous_trip_purpose\n", - " trip_taker_building_type\n", " transit_submode\n", - " trip_taker_work_st_2020\n", - " trip_taker_household_size\n", - " origin_cty_2020\n", - " destination_land_use\n", - " trip_taker_industry\n", - " trip_taker_tenure\n", - " vehicle_fuel_type\n", - " trip_taker_home_trct_2020\n", - " trip_taker_work_trct_2020\n", - " trip_taker_education\n", - " trip_start_time\n", - " trip_taker_individual_income\n", - " trip_taker_employment_status\n", - " trip_purpose\n", - " origin_land_use\n", - " trip_taker_work_cty_2020\n", - " trip_distance_miles\n", - " trip_taker_school_grade_attending\n", - " trip_taker_home_cty_2020\n", - " trip_taker_person_id\n", - " trip_end_time\n", + " transit_agency\n", + " n\n", " \n", " \n", " \n", " \n", - " 115980\n", - " single_family\n", - " 8\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " hispanic_or_latino_origin\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 28.0\n", - " 11649742760210152290\n", - " 2 (Tract 180, San Francisco, CA)\n", - " industrial\n", - " in_person\n", - " California\n", - " San Francisco\n", - " 2 (Tract 180, San Francisco, CA)\n", - " 180 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " private_auto\n", - " three_plus\n", - " auto_passenger\n", - " home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " industrial\n", - " naics31_33\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 180 (San Francisco, CA)\n", - " bachelors_degree\n", - " 07:26:00\n", - " 136907.0\n", - " employed\n", - " work\n", - " single_family\n", - " San Francisco\n", - " 4.3\n", - " not_attending_school\n", - " San Francisco\n", - " 10066255028734967962\n", - " 07:34:11\n", + " 4\n", + " public_transit\n", + " bus\n", + " AC TRANSIT\n", + " 2788\n", " \n", " \n", - " 116099\n", - " industrial\n", - " 8\n", - " indo_european\n", - " 180 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " hispanic_or_latino_origin\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 28.0\n", - " 3527929229602445979\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " in_person\n", - " California\n", - " San Francisco\n", - " 2 (Tract 180, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 2 (Tract 180, San Francisco, CA)\n", - " private_auto\n", - " three_plus\n", - " auto_passenger\n", - " work\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " single_family\n", - " naics31_33\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 180 (San Francisco, CA)\n", - " bachelors_degree\n", - " 10:34:00\n", - " 136907.0\n", - " employed\n", - " home\n", - " industrial\n", - " San Francisco\n", - " 4.4\n", - " not_attending_school\n", - " San Francisco\n", - " 10066255028734967962\n", - " 10:42:11\n", + " 16\n", + " public_transit\n", + " bus, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 632\n", " \n", " \n", - " 257674\n", - " retail\n", - " 20\n", - " indo_european\n", - " 4028.01 (Alameda, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " asian_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 22.0\n", - " 17607258221711465814\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " remote\n", - " California\n", - " San Francisco\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 4028.01, Alameda, CA)\n", - " worked_from_home\n", - " three_plus\n", - " private_auto\n", - " shop\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " Alameda\n", - " single_family\n", - " naics62\n", - " renter\n", - " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 17:23:00\n", - " 76878.0\n", - " employed\n", - " home\n", - " retail\n", - " San Francisco\n", - " 8.3\n", - " not_attending_school\n", - " San Francisco\n", - " 1325181746552868554\n", - " 17:43:25\n", + " 12\n", + " public_transit\n", + " bus, bus\n", + " AC TRANSIT, San Francisco Municipal Transporta...\n", + " 516\n", " \n", " \n", - " 257680\n", - " retail\n", - " 6\n", - " indo_european\n", - " 615.06 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 27.0\n", - " 4258107892431763503\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " remote\n", - " California\n", - " San Francisco\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 3 (Tract 615.06, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " shop\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " single_family\n", - " naics54\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 23:59:00\n", - " 218735.0\n", - " employed\n", - " home\n", - " mixed_use\n", - " San Francisco\n", - " 3.7\n", - " not_attending_school\n", - " San Francisco\n", - " 14409692340574959811\n", - " 00:05:27\n", + " 10\n", + " public_transit\n", + " bus, bus\n", + " AC TRANSIT, AC TRANSIT\n", + " 263\n", " \n", " \n", - " 257681\n", - " retail\n", - " 18\n", - " indo_european\n", - " 4024 (Alameda, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 30.0\n", - " 12673359255479009442\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " employed_not_working\n", - " California\n", - " San Francisco\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 2 (Tract 4024, Alameda, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " eat\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " Alameda\n", - " single_family\n", - " naics61\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 20:21:00\n", - " 58975.0\n", - " employed\n", - " home\n", - " retail\n", - " San Francisco\n", - " 8.4\n", - " not_attending_school\n", - " San Francisco\n", - " 2310331066900902679\n", - " 20:39:52\n", + " 79\n", + " public_transit\n", + " bus, light_rail\n", + " AC TRANSIT, San Francisco Municipal Transporta...\n", + " 253\n", " \n", " \n", - " 257700\n", - " single_family\n", - " 20\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " asian_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 22.0\n", - " 11796209862395850822\n", - " 1 (Tract 4028.01, Alameda, CA)\n", - " retail\n", - " remote\n", - " California\n", - " Alameda\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 4028.01 (Alameda, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " retail\n", - " naics62\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 18:16:00\n", - " 76878.0\n", - " employed\n", - " shop\n", - " single_family\n", - " San Francisco\n", - " 8.8\n", - " not_attending_school\n", - " San Francisco\n", - " 1325181746552868554\n", - " 18:36:37\n", + " 18\n", + " public_transit\n", + " bus, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 234\n", " \n", " \n", - " 257740\n", - " retail\n", - " 18\n", - " indo_european\n", - " 4028.01 (Alameda, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " asian_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 22.0\n", - " 2907192578427799826\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " remote\n", - " California\n", - " San Francisco\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 4028.01, Alameda, CA)\n", - " worked_from_home\n", - " three_plus\n", - " private_auto\n", - " shop\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " Alameda\n", - " single_family\n", - " naics62\n", - " renter\n", - " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 20:25:00\n", - " 76878.0\n", - " employed\n", - " home\n", - " retail\n", - " San Francisco\n", - " 8.3\n", - " not_attending_school\n", - " San Francisco\n", - " 1325181746552868554\n", - " 20:43:21\n", + " 7\n", + " public_transit\n", + " bus\n", + " San Francisco Municipal Transportation Agency\n", + " 197\n", " \n", " \n", - " 257742\n", - " retail\n", - " 25\n", - " indo_european\n", - " 131.01 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 32.0\n", - " 5191863901574759911\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " remote\n", - " California\n", - " San Francisco\n", - " 2 (Tract 231.03, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 4 (Tract 131.01, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " shop\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " single_family\n", - " naics31_33\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 231.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 13:52:00\n", - " 184297.0\n", - " employed\n", - " work_from_home\n", - " mixed_use\n", - " San Francisco\n", - " 7.7\n", - " not_attending_school\n", - " San Francisco\n", - " 11058477761487230854\n", - " 14:17:22\n", + " 120\n", + " public_transit\n", + " light_rail, bus, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 91\n", " \n", " \n", - " 257752\n", - " open_space\n", - " 13\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 34.0\n", - " 14240036214978350700\n", - " 1 (Tract 125.03, San Francisco, CA)\n", - " retail\n", - " remote\n", - " California\n", - " San Francisco\n", - " 2 (Tract 231.03, San Francisco, CA)\n", - " 125.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " recreation\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " mixed_use\n", - " naics31_33\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 231.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 07:53:00\n", - " 141119.0\n", - " employed\n", - " eat\n", - " mixed_use\n", - " San Francisco\n", - " 4.7\n", - " not_attending_school\n", - " San Francisco\n", - " 4746831412975349070\n", - " 08:06:39\n", + " 35\n", + " public_transit\n", + " bus, bus, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 79\n", " \n", " \n", - " 257766\n", - " single_family\n", - " 25\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " female\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 30.0\n", - " 2137638304573734673\n", - " 2 (Tract 3690.01, Contra Costa, CA)\n", - " office\n", - " employed_not_working\n", - " California\n", - " Contra Costa\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 3690.01 (Contra Costa, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " office\n", - " naics61\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 09:07:00\n", - " 58975.0\n", - " employed\n", - " shop\n", - " single_family\n", - " San Francisco\n", - " 15.3\n", - " not_attending_school\n", - " San Francisco\n", - " 2310331066900902679\n", - " 09:32:34\n", + " 37\n", + " public_transit\n", + " bus, bus, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 69\n", " \n", " \n", - " 257782\n", - " single_family\n", - " 21\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 32.0\n", - " 10545008242635224783\n", - " 4 (Tract 131.01, San Francisco, CA)\n", - " retail\n", - " remote\n", - " California\n", - " San Francisco\n", - " 2 (Tract 231.03, San Francisco, CA)\n", - " 131.01 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " mixed_use\n", - " naics31_33\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " 231.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 13:18:00\n", - " 184297.0\n", - " employed\n", - " shop\n", - " single_family\n", - " San Francisco\n", - " 7.6\n", - " not_attending_school\n", - " San Francisco\n", - " 11058477761487230854\n", - " 13:39:06\n", + " 80\n", + " public_transit\n", + " bus, light_rail\n", + " San Francisco Municipal Transportation Agency,...\n", + " 63\n", " \n", " \n", - " 319406\n", - " retail\n", - " 6\n", - " indo_european\n", - " 615.07 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " asian_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 39.0\n", - " 9431701105036513550\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " unemployed_under_16_not_in_labor_force\n", - " California\n", - " San Francisco\n", - " Does not have work/school location\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 615.07, San Francisco, CA)\n", - " other_travel_mode\n", - " three_plus\n", - " auto_passenger\n", - " eat\n", - " single_family\n", - " NaN\n", - " Does not have work/school location\n", - " 10.0\n", - " San Francisco\n", - " single_family\n", - " naics72\n", - " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", - " Does not have work/school location\n", - " high_school\n", - " 22:00:00\n", - " 78984.0\n", - " unemployed\n", - " home\n", - " mixed_use\n", - " Does not have work/school location\n", - " 3.7\n", - " not_attending_school\n", - " San Francisco\n", - " 12894946300265742193\n", - " 22:06:39\n", + " 143\n", + " public_transit\n", + " subway, bus\n", + " Bay Area Rapid Transit, San Francisco Municipa...\n", + " 59\n", " \n", " \n", - " 453990\n", - " single_family\n", - " 31\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " hispanic_or_latino_origin\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 28.0\n", - " 2183541693988403968\n", - " 2 (Tract 231.03, San Francisco, CA)\n", - " industrial\n", - " in_person\n", - " California\n", - " San Francisco\n", - " 2 (Tract 180, San Francisco, CA)\n", - " 231.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " private_auto\n", - " three_plus\n", - " private_auto\n", - " home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " mixed_use\n", - " naics31_33\n", - " renter\n", - " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " 180 (San Francisco, CA)\n", - " bachelors_degree\n", - " 12:44:00\n", - " 136907.0\n", - " employed\n", - " maintenance\n", - " single_family\n", - " San Francisco\n", - " 9.6\n", - " not_attending_school\n", - " San Francisco\n", - " 10066255028734967962\n", - " 13:15:05\n", + " 98\n", + " public_transit\n", + " bus, subway\n", + " San Francisco Municipal Transportation Agency,...\n", + " 52\n", " \n", " \n", - " 454315\n", - " single_family\n", - " 30\n", - " indo_european\n", - " 6019.01 (San Mateo, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " hispanic_or_latino_origin\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 28.0\n", - " 2432377947476950522\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " single_family\n", - " in_person\n", - " California\n", - " San Francisco\n", - " 2 (Tract 180, San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 6019.01, San Mateo, CA)\n", - " private_auto\n", - " three_plus\n", - " private_auto\n", - " social\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Mateo\n", - " single_family\n", - " naics31_33\n", - " renter\n", - " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " 180 (San Francisco, CA)\n", - " bachelors_degree\n", - " 19:53:00\n", - " 136907.0\n", - " employed\n", - " home\n", - " single_family\n", - " San Francisco\n", - " 15.0\n", - " not_attending_school\n", - " San Francisco\n", - " 10066255028734967962\n", - " 20:23:26\n", + " 117\n", + " public_transit\n", + " light_rail, bus\n", + " San Francisco Municipal Transportation Agency,...\n", + " 50\n", " \n", " \n", - " 594828\n", - " single_family\n", - " 10\n", - " indo_european\n", - " 179.03 (San Francisco, CA)\n", - " 8194219563640751815\n", - " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " California\n", - " California\n", - " white_not_hispanic_or_latino\n", - " NaN\n", - " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 27.0\n", - " 15885106788399151556\n", - " 3 (Tract 615.06, San Francisco, CA)\n", - " retail\n", - " remote\n", - " California\n", - " San Francisco\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 615.06 (San Francisco, CA)\n", - " 1200990.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " private_auto\n", - " work_from_home\n", - " single_family\n", - " NaN\n", - " California\n", - " 10.0\n", - " San Francisco\n", - " mixed_use\n", - " naics54\n", - " renter\n", - " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 22:30:00\n", - " 218735.0\n", - " employed\n", - " shop\n", - " single_family\n", - " San Francisco\n", - " 4.0\n", - " not_attending_school\n", - " San Francisco\n", - " 14409692340574959811\n", - " 22:40:27\n", + " 28\n", + " public_transit\n", + " bus, bus, bus\n", + " AC TRANSIT, San Francisco Municipal Transporta...\n", + " 44\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " primary_mode transit_submode \\\n", + "4 public_transit bus \n", + "16 public_transit bus, bus \n", + "12 public_transit bus, bus \n", + "10 public_transit bus, bus \n", + "79 public_transit bus, light_rail \n", + "18 public_transit bus, bus \n", + "7 public_transit bus \n", + "120 public_transit light_rail, bus, bus \n", + "35 public_transit bus, bus, bus \n", + "37 public_transit bus, bus, bus \n", + "80 public_transit bus, light_rail \n", + "143 public_transit subway, bus \n", + "98 public_transit bus, subway \n", + "117 public_transit light_rail, bus \n", + "28 public_transit bus, bus, bus \n", + "\n", + " transit_agency n \n", + "4 AC TRANSIT 2788 \n", + "16 San Francisco Municipal Transportation Agency,... 632 \n", + "12 AC TRANSIT, San Francisco Municipal Transporta... 516 \n", + "10 AC TRANSIT, AC TRANSIT 263 \n", + "79 AC TRANSIT, San Francisco Municipal Transporta... 253 \n", + "18 San Francisco Municipal Transportation Agency,... 234 \n", + "7 San Francisco Municipal Transportation Agency 197 \n", + "120 San Francisco Municipal Transportation Agency,... 91 \n", + "35 San Francisco Municipal Transportation Agency,... 79 \n", + "37 San Francisco Municipal Transportation Agency,... 69 \n", + "80 San Francisco Municipal Transportation Agency,... 63 \n", + "143 Bay Area Rapid Transit, San Francisco Municipa... 59 \n", + "98 San Francisco Municipal Transportation Agency,... 52 \n", + "117 San Francisco Municipal Transportation Agency,... 50 \n", + "28 AC TRANSIT, San Francisco Municipal Transporta... 44 " + ] + }, + "execution_count": 144, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count. \n", + "\n", + "(r_trips>>group_by(_.primary_mode, _.transit_submode)>>count(_.transit_agency)>>filter(_.transit_agency.notnull())>>arrange(-_.n)).head(15)" + ] + }, + { + "cell_type": "code", + "execution_count": 145, + "id": "f3c31371-899f-4474-85b6-86e78e89209b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
transit_submoden
594837single_family27indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.08124378838850198162 (Tract 3690.01, Contra Costa, CA)officeemployed_not_workingCaliforniaContra Costa1 (Tract 179.03, San Francisco, CA)3690.01 (Contra Costa, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoofficenaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:15:0058975.0employedshopsingle_familySan Francisco15.3not_attending_schoolSan Francisco231033106690090267915:42:310bus2999
594840retail7indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0128416754049579796411 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree12:50:00218735.0employedwork_from_homemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981112:57:011bus, bus1706
594856single_family11indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.078783471048378956383 (Tract 615.06, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)615.06 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusprivate_autohomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics54renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:44:00218735.0employedshopsingle_familySan Francisco4.0not_attending_schoolSan Francisco1440969234057495981111:55:0721bus, light_rail316
594859single_family19indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0170742202348262979312 (Tract 4024, Alameda, CA)retailemployed_not_workingCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4024 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree19:08:0058975.0employedeatsingle_familySan Francisco8.5not_attending_schoolSan Francisco231033106690090267919:27:482bus, bus, bus302
594862single_family14indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.070171872167603447431 (Tract 4028.01, Alameda, CA)retailremoteCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerwork_from_homesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree16:09:0076878.0employedshopsingle_familySan Francisco7.6not_attending_schoolSan Francisco132518174655286855416:23:2241light_rail, bus, bus127
594873office25indo_european3690.01 (Contra Costa, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0158848542161360155521 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0Contra Costasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:50:3158975.0employedhomeofficeSan Francisco14.9not_attending_schoolSan Francisco231033106690090267916:16:2840light_rail, bus76
594877retail13indo_european125.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type34.027828652091505974131 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 125.03, San Francisco, CA)worked_from_homethree_plusauto_passengereatsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree09:55:00141119.0employedwork_from_homemixed_useSan Francisco4.9not_attending_schoolSan Francisco474683141297534907010:08:1155subway, bus66
594894single_family9indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latino32bus, subway63
14bus, bus, light_rail49
33bus, subway, bus46
22bus, light_rail, bus35
18bus, bus, subway34
39light_rail28
3bus, bus, bus, bus25
59NaN24
\n", + "
" + ], + "text/plain": [ + " transit_submode n\n", + "0 bus 2999\n", + "1 bus, bus 1706\n", + "21 bus, light_rail 316\n", + "2 bus, bus, bus 302\n", + "41 light_rail, bus, bus 127\n", + "40 light_rail, bus 76\n", + "55 subway, bus 66\n", + "32 bus, subway 63\n", + "14 bus, bus, light_rail 49\n", + "33 bus, subway, bus 46\n", + "22 bus, light_rail, bus 35\n", + "18 bus, bus, subway 34\n", + "39 light_rail 28\n", + "3 bus, bus, bus, bus 25\n", + "59 NaN 24" + ] + }, + "execution_count": 145, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## most common transit mode combinations\n", + "(r_trips>>filter(_.primary_mode ==\"public_transit\")>>count(_.transit_submode)>>arrange(-_.n)).head(15)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f7b51fbb-8b87-4863-bcd9-50ed5047d7d6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", + "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", + "
trip_taker_household_idn
24868627897
262322NaN16384
110604819421956364075181528
82299609777131291778859627
74914555246788117181473022
.........
26231299884893668902201881
26231699913423094393305601
26231799924909034298666651
26231899925996610099430061
26231999935884836945191521
\n", + "

262323 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " trip_taker_household_id n\n", + "248686 27897\n", + "262322 NaN 16384\n", + "110604 8194219563640751815 28\n", + "82299 6097771312917788596 27\n", + "74914 5552467881171814730 22\n", + "... ... ...\n", + "262312 9988489366890220188 1\n", + "262316 9991342309439330560 1\n", + "262317 9992490903429866665 1\n", + "262318 9992599661009943006 1\n", + "262319 9993588483694519152 1\n", + "\n", + "[262323 rows x 2 columns]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>count(_.trip_taker_household_id)>>arrange(-_.n)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "id": "34f3079c-34b8-41e6-be02-ade8f229926a", + "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", @@ -2072,153 +1725,153 @@ " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -2227,7 +1880,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2238,32 +1891,32 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2272,53 +1925,53 @@ " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -2327,78 +1980,1288 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - "
origin_building_usetrip_duration_minutestrip_taker_languageorigin_trct_2020trip_taker_household_idtrip_taker_sextrip_taker_home_bgrp_2020origin_st_2020trip_taker_home_st_2020trip_taker_race_ethnicitytransit_agencytransit_routetrip_taker_resident_typevehicle_typetrip_taker_ageactivity_iddestination_bgrp_2020destination_building_usetrip_taker_wfhdestination_st_2020destination_cty_2020trip_taker_work_bgrp_2020destination_trct_2020trip_taker_household_incomeorigin_bgrp_2020trip_taker_commute_modetrip_taker_available_vehiclesprimary_modeprevious_trip_purposetrip_taker_building_typetransit_submodetrip_taker_work_st_2020trip_taker_household_sizeorigin_cty_2020destination_land_usetrip_taker_industrytrip_taker_tenurevehicle_fuel_typetrip_taker_home_trct_2020trip_taker_work_trct_2020trip_taker_educationtrip_start_timetrip_taker_individual_incometrip_taker_employment_statustrip_purposeorigin_land_usetrip_taker_work_cty_2020trip_distance_milestrip_taker_school_grade_attendingtrip_taker_home_cty_2020trip_taker_person_idtrip_end_time
115980single_family8indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type22.046418471271854126672 (Tract 176.02, San Francisco, CA)retailremote28.0116497427602101522902 (Tract 180, San Francisco, CA)industrialin_personCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)176.02 (San Francisco, CA)2 (Tract 180, San Francisco, CA)180 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homeprivate_autothree_plusauto_passengerhomeCalifornia10.0San Franciscoretailnaics62industrialnaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree13:50:0076878.007:26:00136907.0employedshopworksingle_familySan Francisco4.84.3not_attending_schoolSan Francisco132518174655286855413:59:551006625502873496796207:34:11
594901office23116099industrial8indo_european3690.01 (Contra Costa, CA)180 (San Francisco, CA)8194219563640751815femalemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinohispanic_or_latino_originNaNNaNcoreunknown_vehicle_type30.01546622233749519859128.035279292296024459791 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingin_personCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)2 (Tract 180, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_home2 (Tract 180, San Francisco, CA)private_autothree_plusauto_passengershopworksingle_familyNaNCalifornia10.0Contra CostaSan Franciscosingle_familynaics61naics31_33renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree13:10:0058975.010:34:00136907.0employedhomeofficeindustrialSan Francisco14.94.4not_attending_schoolSan Francisco231033106690090267913:33:441006625502873496796210:42:11
594935single_family14257674retail20indo_european179.03 (San Francisco, CA)4028.01 (Alameda, CA)8194219563640751815malefemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0135315509748273377653 (Tract 117, San Francisco, CA)retail22.0176072582217114658141 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)117 (San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)1 (Tract 4028.01, Alameda, CA)worked_from_homethree_plusauto_passengerhomeprivate_autoshopsingle_familyNaNCalifornia10.0San Franciscoretailnaics54Alamedasingle_familynaics62renterunknown_fuel_typeother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree09:18:00218735.017:23:0076878.0employedshopsingle_familyhomeretailSan Francisco5.08.3not_attending_schoolSan Francisco1440969234057495981109:32:26132518174655286855417:43:25
594962257680retail166indo_european176.02 (San Francisco, CA)615.06 (San Francisco, CA)8194219563640751815femalemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinowhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.0196710488209944715027.042581078924317635031 (Tract 179.03, San Francisco, CA)single_familyremote1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 176.02, San Francisco, CA)3 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passenger10.0San Franciscosingle_familynaics62naics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree14:31:0076878.023:59:00218735.0employedwork_from_homeretailhomemixed_useSan Francisco4.83.7not_attending_schoolSan Francisco132518174655286855414:47:491440969234057495981100:05:27
594972257681retail618indo_european615.06 (San Francisco, CA)4024 (Alameda, CA)8194219563640751815malefemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaNaNcoreunknown_vehicle_type27.0139739079581145050230.0126733592554790094421 (Tract 179.03, San Francisco, CA)single_familyremoteemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)2 (Tract 4024, Alameda, CA)worked_from_homethree_plusauto_passengershopeatsingle_familyNaNCalifornia10.0San FranciscoAlamedasingle_familynaics54naics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:24:00218735.020:21:0058975.0employedhomemixed_useretailSan Francisco3.78.4not_attending_schoolSan Francisco1440969234057495981111:30:46231033106690090267920:39:52
656110257700single_family920indo_european179.03 (San Francisco, CA)8194219563640751815malefemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaNaNcoreunknown_vehicle_type39.0135410986435712566981 (Tract 615.07, San Francisco, CA)22.0117962098623958508221 (Tract 4028.01, Alameda, CA)retailunemployed_under_16_not_in_labor_forceremoteCaliforniaSan FranciscoDoes not have work/school location615.07 (San Francisco, CA)Alameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)other_travel_modeworked_from_homethree_plusprivate_autoauto_passengerhomesingle_familyNaNDoes not have work/school locationCalifornia10.0San Franciscomixed_usenaics72retailnaics62renterother_non_bevunknown_fuel_type179.03 (San Francisco, CA)Does not have work/school locationhigh_school18:10:0078984.0unemployedeat179.03 (San Francisco, CA)bachelors_degree18:16:0076878.0employedshopsingle_familyDoes not have work/school location3.9San Francisco8.8not_attending_schoolSan Francisco1289494630026574219318:19:12132518174655286855418:36:37
\n", - "
" - ], - "text/plain": [ - " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "115980 single_family 8 indo_european \n", - "116099 industrial 8 indo_european \n", - "257674 retail 20 indo_european \n", - "257680 retail 6 indo_european \n", - "257681 retail 18 indo_european \n", - "257700 single_family 20 indo_european \n", - "257740 retail 18 indo_european \n", - "257742 retail 25 indo_european \n", - "257752 open_space 13 indo_european \n", - "257766 single_family 25 indo_european \n", - "257782 single_family 21 indo_european \n", - "319406 retail 6 indo_european \n", - "453990 single_family 31 indo_european \n", - "454315 single_family 30 indo_european \n", - "594828 single_family 10 indo_european \n", - "594837 single_family 27 indo_european \n", - "594840 retail 7 indo_european \n", - "594856 single_family 11 indo_european \n", - "594859 single_family 19 indo_european \n", - "594862 single_family 14 indo_european \n", - "594873 office 25 indo_european \n", - "594877 retail 13 indo_european \n", - "594894 single_family 9 indo_european \n", - "594901 office 23 indo_european \n", - "594935 single_family 14 indo_european \n", - "594962 retail 16 indo_european \n", - "594972 retail 6 indo_european \n", + " \n", + " 257740\n", + " retail\n", + " 18\n", + " indo_european\n", + " 4028.01 (Alameda, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 22.0\n", + " 2907192578427799826\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 4028.01, Alameda, CA)\n", + " worked_from_home\n", + " three_plus\n", + " private_auto\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " Alameda\n", + " single_family\n", + " naics62\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 20:25:00\n", + " 76878.0\n", + " employed\n", + " home\n", + " retail\n", + " San Francisco\n", + " 8.3\n", + " not_attending_school\n", + " San Francisco\n", + " 1325181746552868554\n", + " 20:43:21\n", + " \n", + " \n", + " 257742\n", + " retail\n", + " 25\n", + " indo_european\n", + " 131.01 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 32.0\n", + " 5191863901574759911\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 2 (Tract 231.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 4 (Tract 131.01, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics31_33\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 231.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 13:52:00\n", + " 184297.0\n", + " employed\n", + " work_from_home\n", + " mixed_use\n", + " San Francisco\n", + " 7.7\n", + " not_attending_school\n", + " San Francisco\n", + " 11058477761487230854\n", + " 14:17:22\n", + " \n", + " \n", + " 257752\n", + " open_space\n", + " 13\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 34.0\n", + " 14240036214978350700\n", + " 1 (Tract 125.03, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 2 (Tract 231.03, San Francisco, CA)\n", + " 125.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " recreation\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics31_33\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 231.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 07:53:00\n", + " 141119.0\n", + " employed\n", + " eat\n", + " mixed_use\n", + " San Francisco\n", + " 4.7\n", + " not_attending_school\n", + " San Francisco\n", + " 4746831412975349070\n", + " 08:06:39\n", + " \n", + " \n", + " 257766\n", + " single_family\n", + " 25\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 30.0\n", + " 2137638304573734673\n", + " 2 (Tract 3690.01, Contra Costa, CA)\n", + " office\n", + " employed_not_working\n", + " California\n", + " Contra Costa\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 3690.01 (Contra Costa, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " office\n", + " naics61\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 09:07:00\n", + " 58975.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 15.3\n", + " not_attending_school\n", + " San Francisco\n", + " 2310331066900902679\n", + " 09:32:34\n", + " \n", + " \n", + " 257782\n", + " single_family\n", + " 21\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 32.0\n", + " 10545008242635224783\n", + " 4 (Tract 131.01, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 2 (Tract 231.03, San Francisco, CA)\n", + " 131.01 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics31_33\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 231.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 13:18:00\n", + " 184297.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 7.6\n", + " not_attending_school\n", + " San Francisco\n", + " 11058477761487230854\n", + " 13:39:06\n", + " \n", + " \n", + " 319406\n", + " retail\n", + " 6\n", + " indo_european\n", + " 615.07 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 39.0\n", + " 9431701105036513550\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " unemployed_under_16_not_in_labor_force\n", + " California\n", + " San Francisco\n", + " Does not have work/school location\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 615.07, San Francisco, CA)\n", + " other_travel_mode\n", + " three_plus\n", + " auto_passenger\n", + " eat\n", + " single_family\n", + " NaN\n", + " Does not have work/school location\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics72\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " Does not have work/school location\n", + " high_school\n", + " 22:00:00\n", + " 78984.0\n", + " unemployed\n", + " home\n", + " mixed_use\n", + " Does not have work/school location\n", + " 3.7\n", + " not_attending_school\n", + " San Francisco\n", + " 12894946300265742193\n", + " 22:06:39\n", + " \n", + " \n", + " 453990\n", + " single_family\n", + " 31\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " hispanic_or_latino_origin\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 28.0\n", + " 2183541693988403968\n", + " 2 (Tract 231.03, San Francisco, CA)\n", + " industrial\n", + " in_person\n", + " California\n", + " San Francisco\n", + " 2 (Tract 180, San Francisco, CA)\n", + " 231.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " private_auto\n", + " three_plus\n", + " private_auto\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics31_33\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " 180 (San Francisco, CA)\n", + " bachelors_degree\n", + " 12:44:00\n", + " 136907.0\n", + " employed\n", + " maintenance\n", + " single_family\n", + " San Francisco\n", + " 9.6\n", + " not_attending_school\n", + " San Francisco\n", + " 10066255028734967962\n", + " 13:15:05\n", + " \n", + " \n", + " 454315\n", + " single_family\n", + " 30\n", + " indo_european\n", + " 6019.01 (San Mateo, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " hispanic_or_latino_origin\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 28.0\n", + " 2432377947476950522\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " in_person\n", + " California\n", + " San Francisco\n", + " 2 (Tract 180, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 6019.01, San Mateo, CA)\n", + " private_auto\n", + " three_plus\n", + " private_auto\n", + " social\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Mateo\n", + " single_family\n", + " naics31_33\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " 180 (San Francisco, CA)\n", + " bachelors_degree\n", + " 19:53:00\n", + " 136907.0\n", + " employed\n", + " home\n", + " single_family\n", + " San Francisco\n", + " 15.0\n", + " not_attending_school\n", + " San Francisco\n", + " 10066255028734967962\n", + " 20:23:26\n", + " \n", + " \n", + " 594828\n", + " single_family\n", + " 10\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 27.0\n", + " 15885106788399151556\n", + " 3 (Tract 615.06, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 615.06 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " private_auto\n", + " work_from_home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics54\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 22:30:00\n", + " 218735.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 4.0\n", + " not_attending_school\n", + " San Francisco\n", + " 14409692340574959811\n", + " 22:40:27\n", + " \n", + " \n", + " 594837\n", + " single_family\n", + " 27\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 30.0\n", + " 812437883885019816\n", + " 2 (Tract 3690.01, Contra Costa, CA)\n", + " office\n", + " employed_not_working\n", + " California\n", + " Contra Costa\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 3690.01 (Contra Costa, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " office\n", + " naics61\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 15:15:00\n", + " 58975.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 15.3\n", + " not_attending_school\n", + " San Francisco\n", + " 2310331066900902679\n", + " 15:42:31\n", + " \n", + " \n", + " 594840\n", + " retail\n", + " 7\n", + " indo_european\n", + " 615.06 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 27.0\n", + " 12841675404957979641\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 3 (Tract 615.06, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics54\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 12:50:00\n", + " 218735.0\n", + " employed\n", + " work_from_home\n", + " mixed_use\n", + " San Francisco\n", + " 3.7\n", + " not_attending_school\n", + " San Francisco\n", + " 14409692340574959811\n", + " 12:57:01\n", + " \n", + " \n", + " 594856\n", + " single_family\n", + " 11\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 27.0\n", + " 7878347104837895638\n", + " 3 (Tract 615.06, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 615.06 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " private_auto\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics54\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 11:44:00\n", + " 218735.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 4.0\n", + " not_attending_school\n", + " San Francisco\n", + " 14409692340574959811\n", + " 11:55:07\n", + " \n", + " \n", + " 594859\n", + " single_family\n", + " 19\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 30.0\n", + " 17074220234826297931\n", + " 2 (Tract 4024, Alameda, CA)\n", + " retail\n", + " employed_not_working\n", + " California\n", + " Alameda\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 4024 (Alameda, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " retail\n", + " naics61\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 19:08:00\n", + " 58975.0\n", + " employed\n", + " eat\n", + " single_family\n", + " San Francisco\n", + " 8.5\n", + " not_attending_school\n", + " San Francisco\n", + " 2310331066900902679\n", + " 19:27:48\n", + " \n", + " \n", + " 594862\n", + " single_family\n", + " 14\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 22.0\n", + " 7017187216760344743\n", + " 1 (Tract 4028.01, Alameda, CA)\n", + " retail\n", + " remote\n", + " California\n", + " Alameda\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 4028.01 (Alameda, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " work_from_home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " retail\n", + " naics62\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 16:09:00\n", + " 76878.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 7.6\n", + " not_attending_school\n", + " San Francisco\n", + " 1325181746552868554\n", + " 16:23:22\n", + " \n", + " \n", + " 594873\n", + " office\n", + " 25\n", + " indo_european\n", + " 3690.01 (Contra Costa, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 30.0\n", + " 15884854216136015552\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " employed_not_working\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 2 (Tract 3690.01, Contra Costa, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " Contra Costa\n", + " single_family\n", + " naics61\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 15:50:31\n", + " 58975.0\n", + " employed\n", + " home\n", + " office\n", + " San Francisco\n", + " 14.9\n", + " not_attending_school\n", + " San Francisco\n", + " 2310331066900902679\n", + " 16:16:28\n", + " \n", + " \n", + " 594877\n", + " retail\n", + " 13\n", + " indo_european\n", + " 125.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 34.0\n", + " 2782865209150597413\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 2 (Tract 231.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 125.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " eat\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics31_33\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 231.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 09:55:00\n", + " 141119.0\n", + " employed\n", + " work_from_home\n", + " mixed_use\n", + " San Francisco\n", + " 4.9\n", + " not_attending_school\n", + " San Francisco\n", + " 4746831412975349070\n", + " 10:08:11\n", + " \n", + " \n", + " 594894\n", + " single_family\n", + " 9\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 22.0\n", + " 4641847127185412667\n", + " 2 (Tract 176.02, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 176.02 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " retail\n", + " naics62\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 13:50:00\n", + " 76878.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 4.8\n", + " not_attending_school\n", + " San Francisco\n", + " 1325181746552868554\n", + " 13:59:55\n", + " \n", + " \n", + " 594901\n", + " office\n", + " 23\n", + " indo_european\n", + " 3690.01 (Contra Costa, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 30.0\n", + " 15466222337495198591\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " employed_not_working\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 2 (Tract 3690.01, Contra Costa, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " Contra Costa\n", + " single_family\n", + " naics61\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 13:10:00\n", + " 58975.0\n", + " employed\n", + " home\n", + " office\n", + " San Francisco\n", + " 14.9\n", + " not_attending_school\n", + " San Francisco\n", + " 2310331066900902679\n", + " 13:33:44\n", + " \n", + " \n", + " 594935\n", + " single_family\n", + " 14\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 27.0\n", + " 13531550974827337765\n", + " 3 (Tract 117, San Francisco, CA)\n", + " retail\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 117 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " home\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " retail\n", + " naics54\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 09:18:00\n", + " 218735.0\n", + " employed\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 5.0\n", + " not_attending_school\n", + " San Francisco\n", + " 14409692340574959811\n", + " 09:32:26\n", + " \n", + " \n", + " 594962\n", + " retail\n", + " 16\n", + " indo_european\n", + " 176.02 (San Francisco, CA)\n", + " 8194219563640751815\n", + " female\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 22.0\n", + " 1967104882099447150\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 2 (Tract 176.02, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics62\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 14:31:00\n", + " 76878.0\n", + " employed\n", + " work_from_home\n", + " retail\n", + " San Francisco\n", + " 4.8\n", + " not_attending_school\n", + " San Francisco\n", + " 1325181746552868554\n", + " 14:47:49\n", + " \n", + " \n", + " 594972\n", + " retail\n", + " 6\n", + " indo_european\n", + " 615.06 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " white_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 27.0\n", + " 1397390795811450502\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", + " California\n", + " San Francisco\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 3 (Tract 615.06, San Francisco, CA)\n", + " worked_from_home\n", + " three_plus\n", + " auto_passenger\n", + " shop\n", + " single_family\n", + " NaN\n", + " California\n", + " 10.0\n", + " San Francisco\n", + " single_family\n", + " naics54\n", + " renter\n", + " unknown_fuel_type\n", + " 179.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 11:24:00\n", + " 218735.0\n", + " employed\n", + " home\n", + " mixed_use\n", + " San Francisco\n", + " 3.7\n", + " not_attending_school\n", + " San Francisco\n", + " 14409692340574959811\n", + " 11:30:46\n", + " \n", + " \n", + " 656110\n", + " single_family\n", + " 9\n", + " indo_european\n", + " 179.03 (San Francisco, CA)\n", + " 8194219563640751815\n", + " male\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " California\n", + " California\n", + " asian_not_hispanic_or_latino\n", + " NaN\n", + " NaN\n", + " core\n", + " unknown_vehicle_type\n", + " 39.0\n", + " 13541098643571256698\n", + " 1 (Tract 615.07, San Francisco, CA)\n", + " retail\n", + " unemployed_under_16_not_in_labor_force\n", + " California\n", + " San Francisco\n", + " Does not have work/school location\n", + " 615.07 (San Francisco, CA)\n", + " 1200990.0\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " other_travel_mode\n", + " three_plus\n", + " private_auto\n", + " home\n", + " single_family\n", + " NaN\n", + " Does not have work/school location\n", + " 10.0\n", + " San Francisco\n", + " mixed_use\n", + " naics72\n", + " renter\n", + " other_non_bev\n", + " 179.03 (San Francisco, CA)\n", + " Does not have work/school location\n", + " high_school\n", + " 18:10:00\n", + " 78984.0\n", + " unemployed\n", + " eat\n", + " single_family\n", + " Does not have work/school location\n", + " 3.9\n", + " not_attending_school\n", + " San Francisco\n", + " 12894946300265742193\n", + " 18:19:12\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "115980 single_family 8 indo_european \n", + "116099 industrial 8 indo_european \n", + "257674 retail 20 indo_european \n", + "257680 retail 6 indo_european \n", + "257681 retail 18 indo_european \n", + "257700 single_family 20 indo_european \n", + "257740 retail 18 indo_european \n", + "257742 retail 25 indo_european \n", + "257752 open_space 13 indo_european \n", + "257766 single_family 25 indo_european \n", + "257782 single_family 21 indo_european \n", + "319406 retail 6 indo_european \n", + "453990 single_family 31 indo_european \n", + "454315 single_family 30 indo_european \n", + "594828 single_family 10 indo_european \n", + "594837 single_family 27 indo_european \n", + "594840 retail 7 indo_european \n", + "594856 single_family 11 indo_european \n", + "594859 single_family 19 indo_european \n", + "594862 single_family 14 indo_european \n", + "594873 office 25 indo_european \n", + "594877 retail 13 indo_european \n", + "594894 single_family 9 indo_european \n", + "594901 office 23 indo_european \n", + "594935 single_family 14 indo_european \n", + "594962 retail 16 indo_european \n", + "594972 retail 6 indo_european \n", "656110 single_family 9 indo_european \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", @@ -2761,350 +3624,924 @@ "594972 single_family NaN \n", "656110 single_family NaN \n", "\n", - " trip_taker_work_st_2020 trip_taker_household_size \\\n", - "115980 California 10.0 \n", - "116099 California 10.0 \n", - "257674 California 10.0 \n", - "257680 California 10.0 \n", - "257681 California 10.0 \n", - "257700 California 10.0 \n", - "257740 California 10.0 \n", - "257742 California 10.0 \n", - "257752 California 10.0 \n", - "257766 California 10.0 \n", - "257782 California 10.0 \n", - "319406 Does not have work/school location 10.0 \n", - "453990 California 10.0 \n", - "454315 California 10.0 \n", - "594828 California 10.0 \n", - "594837 California 10.0 \n", - "594840 California 10.0 \n", - "594856 California 10.0 \n", - "594859 California 10.0 \n", - "594862 California 10.0 \n", - "594873 California 10.0 \n", - "594877 California 10.0 \n", - "594894 California 10.0 \n", - "594901 California 10.0 \n", - "594935 California 10.0 \n", - "594962 California 10.0 \n", - "594972 California 10.0 \n", - "656110 Does not have work/school location 10.0 \n", + " trip_taker_work_st_2020 trip_taker_household_size \\\n", + "115980 California 10.0 \n", + "116099 California 10.0 \n", + "257674 California 10.0 \n", + "257680 California 10.0 \n", + "257681 California 10.0 \n", + "257700 California 10.0 \n", + "257740 California 10.0 \n", + "257742 California 10.0 \n", + "257752 California 10.0 \n", + "257766 California 10.0 \n", + "257782 California 10.0 \n", + "319406 Does not have work/school location 10.0 \n", + "453990 California 10.0 \n", + "454315 California 10.0 \n", + "594828 California 10.0 \n", + "594837 California 10.0 \n", + "594840 California 10.0 \n", + "594856 California 10.0 \n", + "594859 California 10.0 \n", + "594862 California 10.0 \n", + "594873 California 10.0 \n", + "594877 California 10.0 \n", + "594894 California 10.0 \n", + "594901 California 10.0 \n", + "594935 California 10.0 \n", + "594962 California 10.0 \n", + "594972 California 10.0 \n", + "656110 Does not have work/school location 10.0 \n", + "\n", + " origin_cty_2020 destination_land_use trip_taker_industry \\\n", + "115980 San Francisco industrial naics31_33 \n", + "116099 San Francisco single_family naics31_33 \n", + "257674 Alameda single_family naics62 \n", + "257680 San Francisco single_family naics54 \n", + "257681 Alameda single_family naics61 \n", + "257700 San Francisco retail naics62 \n", + "257740 Alameda single_family naics62 \n", + "257742 San Francisco single_family naics31_33 \n", + "257752 San Francisco mixed_use naics31_33 \n", + "257766 San Francisco office naics61 \n", + "257782 San Francisco mixed_use naics31_33 \n", + "319406 San Francisco single_family naics72 \n", + "453990 San Francisco mixed_use naics31_33 \n", + "454315 San Mateo single_family naics31_33 \n", + "594828 San Francisco mixed_use naics54 \n", + "594837 San Francisco office naics61 \n", + "594840 San Francisco single_family naics54 \n", + "594856 San Francisco mixed_use naics54 \n", + "594859 San Francisco retail naics61 \n", + "594862 San Francisco retail naics62 \n", + "594873 Contra Costa single_family naics61 \n", + "594877 San Francisco single_family naics31_33 \n", + "594894 San Francisco retail naics62 \n", + "594901 Contra Costa single_family naics61 \n", + "594935 San Francisco retail naics54 \n", + "594962 San Francisco single_family naics62 \n", + "594972 San Francisco single_family naics54 \n", + "656110 San Francisco mixed_use naics72 \n", + "\n", + " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "115980 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "116099 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257674 renter other_non_bev 179.03 (San Francisco, CA) \n", + "257680 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257681 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257700 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257740 renter other_non_bev 179.03 (San Francisco, CA) \n", + "257742 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257752 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257766 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "257782 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "319406 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "453990 renter other_non_bev 179.03 (San Francisco, CA) \n", + "454315 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594828 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594837 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594840 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594856 renter other_non_bev 179.03 (San Francisco, CA) \n", + "594859 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594862 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594873 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594877 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594894 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594901 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594935 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594962 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "594972 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", + "656110 renter other_non_bev 179.03 (San Francisco, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education \\\n", + "115980 180 (San Francisco, CA) bachelors_degree \n", + "116099 180 (San Francisco, CA) bachelors_degree \n", + "257674 179.03 (San Francisco, CA) bachelors_degree \n", + "257680 179.03 (San Francisco, CA) bachelors_degree \n", + "257681 179.03 (San Francisco, CA) bachelors_degree \n", + "257700 179.03 (San Francisco, CA) bachelors_degree \n", + "257740 179.03 (San Francisco, CA) bachelors_degree \n", + "257742 231.03 (San Francisco, CA) bachelors_degree \n", + "257752 231.03 (San Francisco, CA) bachelors_degree \n", + "257766 179.03 (San Francisco, CA) bachelors_degree \n", + "257782 231.03 (San Francisco, CA) bachelors_degree \n", + "319406 Does not have work/school location high_school \n", + "453990 180 (San Francisco, CA) bachelors_degree \n", + "454315 180 (San Francisco, CA) bachelors_degree \n", + "594828 179.03 (San Francisco, CA) bachelors_degree \n", + "594837 179.03 (San Francisco, CA) bachelors_degree \n", + "594840 179.03 (San Francisco, CA) bachelors_degree \n", + "594856 179.03 (San Francisco, CA) bachelors_degree \n", + "594859 179.03 (San Francisco, CA) bachelors_degree \n", + "594862 179.03 (San Francisco, CA) bachelors_degree \n", + "594873 179.03 (San Francisco, CA) bachelors_degree \n", + "594877 231.03 (San Francisco, CA) bachelors_degree \n", + "594894 179.03 (San Francisco, CA) bachelors_degree \n", + "594901 179.03 (San Francisco, CA) bachelors_degree \n", + "594935 179.03 (San Francisco, CA) bachelors_degree \n", + "594962 179.03 (San Francisco, CA) bachelors_degree \n", + "594972 179.03 (San Francisco, CA) bachelors_degree \n", + "656110 Does not have work/school location high_school \n", + "\n", + " trip_start_time trip_taker_individual_income \\\n", + "115980 07:26:00 136907.0 \n", + "116099 10:34:00 136907.0 \n", + "257674 17:23:00 76878.0 \n", + "257680 23:59:00 218735.0 \n", + "257681 20:21:00 58975.0 \n", + "257700 18:16:00 76878.0 \n", + "257740 20:25:00 76878.0 \n", + "257742 13:52:00 184297.0 \n", + "257752 07:53:00 141119.0 \n", + "257766 09:07:00 58975.0 \n", + "257782 13:18:00 184297.0 \n", + "319406 22:00:00 78984.0 \n", + "453990 12:44:00 136907.0 \n", + "454315 19:53:00 136907.0 \n", + "594828 22:30:00 218735.0 \n", + "594837 15:15:00 58975.0 \n", + "594840 12:50:00 218735.0 \n", + "594856 11:44:00 218735.0 \n", + "594859 19:08:00 58975.0 \n", + "594862 16:09:00 76878.0 \n", + "594873 15:50:31 58975.0 \n", + "594877 09:55:00 141119.0 \n", + "594894 13:50:00 76878.0 \n", + "594901 13:10:00 58975.0 \n", + "594935 09:18:00 218735.0 \n", + "594962 14:31:00 76878.0 \n", + "594972 11:24:00 218735.0 \n", + "656110 18:10:00 78984.0 \n", + "\n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "115980 employed work single_family \n", + "116099 employed home industrial \n", + "257674 employed home retail \n", + "257680 employed home mixed_use \n", + "257681 employed home retail \n", + "257700 employed shop single_family \n", + "257740 employed home retail \n", + "257742 employed work_from_home mixed_use \n", + "257752 employed eat mixed_use \n", + "257766 employed shop single_family \n", + "257782 employed shop single_family \n", + "319406 unemployed home mixed_use \n", + "453990 employed maintenance single_family \n", + "454315 employed home single_family \n", + "594828 employed shop single_family \n", + "594837 employed shop single_family \n", + "594840 employed work_from_home mixed_use \n", + "594856 employed shop single_family \n", + "594859 employed eat single_family \n", + "594862 employed shop single_family \n", + "594873 employed home office \n", + "594877 employed work_from_home mixed_use \n", + "594894 employed shop single_family \n", + "594901 employed home office \n", + "594935 employed shop single_family \n", + "594962 employed work_from_home retail \n", + "594972 employed home mixed_use \n", + "656110 unemployed eat single_family \n", + "\n", + " trip_taker_work_cty_2020 trip_distance_miles \\\n", + "115980 San Francisco 4.3 \n", + "116099 San Francisco 4.4 \n", + "257674 San Francisco 8.3 \n", + "257680 San Francisco 3.7 \n", + "257681 San Francisco 8.4 \n", + "257700 San Francisco 8.8 \n", + "257740 San Francisco 8.3 \n", + "257742 San Francisco 7.7 \n", + "257752 San Francisco 4.7 \n", + "257766 San Francisco 15.3 \n", + "257782 San Francisco 7.6 \n", + "319406 Does not have work/school location 3.7 \n", + "453990 San Francisco 9.6 \n", + "454315 San Francisco 15.0 \n", + "594828 San Francisco 4.0 \n", + "594837 San Francisco 15.3 \n", + "594840 San Francisco 3.7 \n", + "594856 San Francisco 4.0 \n", + "594859 San Francisco 8.5 \n", + "594862 San Francisco 7.6 \n", + "594873 San Francisco 14.9 \n", + "594877 San Francisco 4.9 \n", + "594894 San Francisco 4.8 \n", + "594901 San Francisco 14.9 \n", + "594935 San Francisco 5.0 \n", + "594962 San Francisco 4.8 \n", + "594972 San Francisco 3.7 \n", + "656110 Does not have work/school location 3.9 \n", + "\n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "115980 not_attending_school San Francisco \n", + "116099 not_attending_school San Francisco \n", + "257674 not_attending_school San Francisco \n", + "257680 not_attending_school San Francisco \n", + "257681 not_attending_school San Francisco \n", + "257700 not_attending_school San Francisco \n", + "257740 not_attending_school San Francisco \n", + "257742 not_attending_school San Francisco \n", + "257752 not_attending_school San Francisco \n", + "257766 not_attending_school San Francisco \n", + "257782 not_attending_school San Francisco \n", + "319406 not_attending_school San Francisco \n", + "453990 not_attending_school San Francisco \n", + "454315 not_attending_school San Francisco \n", + "594828 not_attending_school San Francisco \n", + "594837 not_attending_school San Francisco \n", + "594840 not_attending_school San Francisco \n", + "594856 not_attending_school San Francisco \n", + "594859 not_attending_school San Francisco \n", + "594862 not_attending_school San Francisco \n", + "594873 not_attending_school San Francisco \n", + "594877 not_attending_school San Francisco \n", + "594894 not_attending_school San Francisco \n", + "594901 not_attending_school San Francisco \n", + "594935 not_attending_school San Francisco \n", + "594962 not_attending_school San Francisco \n", + "594972 not_attending_school San Francisco \n", + "656110 not_attending_school San Francisco \n", + "\n", + " trip_taker_person_id trip_end_time \n", + "115980 10066255028734967962 07:34:11 \n", + "116099 10066255028734967962 10:42:11 \n", + "257674 1325181746552868554 17:43:25 \n", + "257680 14409692340574959811 00:05:27 \n", + "257681 2310331066900902679 20:39:52 \n", + "257700 1325181746552868554 18:36:37 \n", + "257740 1325181746552868554 20:43:21 \n", + "257742 11058477761487230854 14:17:22 \n", + "257752 4746831412975349070 08:06:39 \n", + "257766 2310331066900902679 09:32:34 \n", + "257782 11058477761487230854 13:39:06 \n", + "319406 12894946300265742193 22:06:39 \n", + "453990 10066255028734967962 13:15:05 \n", + "454315 10066255028734967962 20:23:26 \n", + "594828 14409692340574959811 22:40:27 \n", + "594837 2310331066900902679 15:42:31 \n", + "594840 14409692340574959811 12:57:01 \n", + "594856 14409692340574959811 11:55:07 \n", + "594859 2310331066900902679 19:27:48 \n", + "594862 1325181746552868554 16:23:22 \n", + "594873 2310331066900902679 16:16:28 \n", + "594877 4746831412975349070 10:08:11 \n", + "594894 1325181746552868554 13:59:55 \n", + "594901 2310331066900902679 13:33:44 \n", + "594935 14409692340574959811 09:32:26 \n", + "594962 1325181746552868554 14:47:49 \n", + "594972 14409692340574959811 11:30:46 \n", + "656110 12894946300265742193 18:19:12 " + ] + }, + "execution_count": 79, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## checking one household id\n", + "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "id": "4eccfdf8-429e-43df-899e-f7d77e051831", + "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", + "
trip_taker_person_idtrip_taker_agetrip_taker_sextrip_taker_household_sizen
0132518174655286855422.0female10.06
1231033106690090267930.0female10.06
2474683141297534907034.0female10.02
31006625502873496796228.0male10.04
41105847776148723085432.0male10.02
51289494630026574219339.0male10.02
61440969234057495981127.0male10.06
\n", + "
" + ], + "text/plain": [ + " trip_taker_person_id trip_taker_age trip_taker_sex \\\n", + "0 1325181746552868554 22.0 female \n", + "1 2310331066900902679 30.0 female \n", + "2 4746831412975349070 34.0 female \n", + "3 10066255028734967962 28.0 male \n", + "4 11058477761487230854 32.0 male \n", + "5 12894946300265742193 39.0 male \n", + "6 14409692340574959811 27.0 male \n", "\n", - " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "115980 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "116099 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257674 renter other_non_bev 179.03 (San Francisco, CA) \n", - "257680 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257681 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257700 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257740 renter other_non_bev 179.03 (San Francisco, CA) \n", - "257742 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257752 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257766 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "257782 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "319406 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "453990 renter other_non_bev 179.03 (San Francisco, CA) \n", - "454315 renter other_non_bev 179.03 (San Francisco, CA) \n", - "594828 renter other_non_bev 179.03 (San Francisco, CA) \n", - "594837 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594840 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594856 renter other_non_bev 179.03 (San Francisco, CA) \n", - "594859 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594862 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594873 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594877 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594894 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594901 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594935 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594962 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "594972 renter unknown_fuel_type 179.03 (San Francisco, CA) \n", - "656110 renter other_non_bev 179.03 (San Francisco, CA) \n", + " trip_taker_household_size n \n", + "0 10.0 6 \n", + "1 10.0 6 \n", + "2 10.0 2 \n", + "3 10.0 4 \n", + "4 10.0 2 \n", + "5 10.0 2 \n", + "6 10.0 6 " + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## checking one household id\n", + "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)>>count(_.trip_taker_person_id, _.trip_taker_age,\n", + " _.trip_taker_sex, _.trip_taker_household_size)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c929c77d-0173-4a7d-be49-762349daf5cb", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ad574f5a-8780-443e-8a16-52387d0a1fb8", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "97f56b20-f299-43f5-bad4-2a42362962e2", + "metadata": {}, + "source": [ + "### Read in Streetlight Data: 2022" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", + "metadata": {}, + "outputs": [], + "source": [ + "streetlight = \"streetlight_bay_bridge_corridor_study_corridor_study.csv\"" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data = to_snakecase(pd.read_csv(f\"{GCS_PATH}{streetlight}\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", + "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", + "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
1249Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1125811810I 80 / 839972874 / 1Motorway0.111yes85EASTno2: Weekend Day (Sa-Su)19: 3pm (3pm-4pm)787662770.037875.091.13False70
1024Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1118036302I 80 / 839972875 / 1Motorway0.006yes265WESTno1: Weekday (M-F)04: 2am (2am-3am)68267268.7623.791.02False75
559Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1093181568San Francisco – Oakland Bay Bridge / 50691047 / 1Motorway0.109yes40EASTno0: All Days (M-Su)19: 3pm (3pm-4pm)936440966.0471020.381.64True56
722Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1112062603San Francisco – Oakland Bay Bridge / 236348361...Motorway1.878yes260WESTno0: All Days (M-Su)02: Early AM (12am-6am)158766410770.40929817.201.09False74
1317Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1128174334San Francisco – Oakland Bay Bridge / 237731428...Motorway0.177yes43EASTno1: Weekday (M-F)27: 9pm (9pm-10pm)6538601167.7491156.191.13False67
\n", + "
" + ], + "text/plain": [ + " data_periods \\\n", + "1249 Jan 01, 2022 - Dec 31, 2022 \n", + "1024 Jan 01, 2022 - Dec 31, 2022 \n", + "559 Jan 01, 2022 - Dec 31, 2022 \n", + "722 Jan 01, 2022 - Dec 31, 2022 \n", + "1317 Jan 01, 2022 - Dec 31, 2022 \n", "\n", - " trip_taker_employment_status trip_purpose origin_land_use \\\n", - "115980 employed work single_family \n", - "116099 employed home industrial \n", - "257674 employed home retail \n", - "257680 employed home mixed_use \n", - "257681 employed home retail \n", - "257700 employed shop single_family \n", - "257740 employed home retail \n", - "257742 employed work_from_home mixed_use \n", - "257752 employed eat mixed_use \n", - "257766 employed shop single_family \n", - "257782 employed shop single_family \n", - "319406 unemployed home mixed_use \n", - "453990 employed maintenance single_family \n", - "454315 employed home single_family \n", - "594828 employed shop single_family \n", - "594837 employed shop single_family \n", - "594840 employed work_from_home mixed_use \n", - "594856 employed shop single_family \n", - "594859 employed eat single_family \n", - "594862 employed shop single_family \n", - "594873 employed home office \n", - "594877 employed work_from_home mixed_use \n", - "594894 employed shop single_family \n", - "594901 employed home office \n", - "594935 employed shop single_family \n", - "594962 employed work_from_home retail \n", - "594972 employed home mixed_use \n", - "656110 unemployed eat single_family \n", + " mode_of_travel zone_id \\\n", + "1249 All Vehicles CVD Plus - StL All Vehicles Volume 1125811810 \n", + "1024 All Vehicles CVD Plus - StL All Vehicles Volume 1118036302 \n", + "559 All Vehicles CVD Plus - StL All Vehicles Volume 1093181568 \n", + "722 All Vehicles CVD Plus - StL All Vehicles Volume 1112062603 \n", + "1317 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", "\n", - " trip_taker_work_cty_2020 trip_distance_miles \\\n", - "115980 San Francisco 4.3 \n", - "116099 San Francisco 4.4 \n", - "257674 San Francisco 8.3 \n", - "257680 San Francisco 3.7 \n", - "257681 San Francisco 8.4 \n", - "257700 San Francisco 8.8 \n", - "257740 San Francisco 8.3 \n", - "257742 San Francisco 7.7 \n", - "257752 San Francisco 4.7 \n", - "257766 San Francisco 15.3 \n", - "257782 San Francisco 7.6 \n", - "319406 Does not have work/school location 3.7 \n", - "453990 San Francisco 9.6 \n", - "454315 San Francisco 15.0 \n", - "594828 San Francisco 4.0 \n", - "594837 San Francisco 15.3 \n", - "594840 San Francisco 3.7 \n", - "594856 San Francisco 4.0 \n", - "594859 San Francisco 8.5 \n", - "594862 San Francisco 7.6 \n", - "594873 San Francisco 14.9 \n", - "594877 San Francisco 4.9 \n", - "594894 San Francisco 4.8 \n", - "594901 San Francisco 14.9 \n", - "594935 San Francisco 5.0 \n", - "594962 San Francisco 4.8 \n", - "594972 San Francisco 3.7 \n", - "656110 Does not have work/school location 3.9 \n", + " zone_name road_classification \\\n", + "1249 I 80 / 839972874 / 1 Motorway \n", + "1024 I 80 / 839972875 / 1 Motorway \n", + "559 San Francisco – Oakland Bay Bridge / 50691047 / 1 Motorway \n", + "722 San Francisco – Oakland Bay Bridge / 236348361... Motorway \n", + "1317 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "1249 0.111 yes 85 \n", + "1024 0.006 yes 265 \n", + "559 0.109 yes 40 \n", + "722 1.878 yes 260 \n", + "1317 0.177 yes 43 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "1249 EAST no 2: Weekend Day (Sa-Su) \n", + "1024 WEST no 1: Weekday (M-F) \n", + "559 EAST no 0: All Days (M-Su) \n", + "722 WEST no 0: All Days (M-Su) \n", + "1317 EAST no 1: Weekday (M-F) \n", "\n", - " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", - "115980 not_attending_school San Francisco \n", - "116099 not_attending_school San Francisco \n", - "257674 not_attending_school San Francisco \n", - "257680 not_attending_school San Francisco \n", - "257681 not_attending_school San Francisco \n", - "257700 not_attending_school San Francisco \n", - "257740 not_attending_school San Francisco \n", - "257742 not_attending_school San Francisco \n", - "257752 not_attending_school San Francisco \n", - "257766 not_attending_school San Francisco \n", - "257782 not_attending_school San Francisco \n", - "319406 not_attending_school San Francisco \n", - "453990 not_attending_school San Francisco \n", - "454315 not_attending_school San Francisco \n", - "594828 not_attending_school San Francisco \n", - "594837 not_attending_school San Francisco \n", - "594840 not_attending_school San Francisco \n", - "594856 not_attending_school San Francisco \n", - "594859 not_attending_school San Francisco \n", - "594862 not_attending_school San Francisco \n", - "594873 not_attending_school San Francisco \n", - "594877 not_attending_school San Francisco \n", - "594894 not_attending_school San Francisco \n", - "594901 not_attending_school San Francisco \n", - "594935 not_attending_school San Francisco \n", - "594962 not_attending_school San Francisco \n", - "594972 not_attending_school San Francisco \n", - "656110 not_attending_school San Francisco \n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1249 19: 3pm (3pm-4pm) 7876 \n", + "1024 04: 2am (2am-3am) 682 \n", + "559 19: 3pm (3pm-4pm) 9364 \n", + "722 02: Early AM (12am-6am) 15876 \n", + "1317 27: 9pm (9pm-10pm) 6538 \n", "\n", - " trip_taker_person_id trip_end_time \n", - "115980 10066255028734967962 07:34:11 \n", - "116099 10066255028734967962 10:42:11 \n", - "257674 1325181746552868554 17:43:25 \n", - "257680 14409692340574959811 00:05:27 \n", - "257681 2310331066900902679 20:39:52 \n", - "257700 1325181746552868554 18:36:37 \n", - "257740 1325181746552868554 20:43:21 \n", - "257742 11058477761487230854 14:17:22 \n", - "257752 4746831412975349070 08:06:39 \n", - "257766 2310331066900902679 09:32:34 \n", - "257782 11058477761487230854 13:39:06 \n", - "319406 12894946300265742193 22:06:39 \n", - "453990 10066255028734967962 13:15:05 \n", - "454315 10066255028734967962 20:23:26 \n", - "594828 14409692340574959811 22:40:27 \n", - "594837 2310331066900902679 15:42:31 \n", - "594840 14409692340574959811 12:57:01 \n", - "594856 14409692340574959811 11:55:07 \n", - "594859 2310331066900902679 19:27:48 \n", - "594862 1325181746552868554 16:23:22 \n", - "594873 2310331066900902679 16:16:28 \n", - "594877 4746831412975349070 10:08:11 \n", - "594894 1325181746552868554 13:59:55 \n", - "594901 2310331066900902679 13:33:44 \n", - "594935 14409692340574959811 09:32:26 \n", - "594962 1325181746552868554 14:47:49 \n", - "594972 14409692340574959811 11:30:46 \n", - "656110 12894946300265742193 18:19:12 " + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "1249 62 7 \n", + "1024 67 2 \n", + "559 40 9 \n", + "722 64 107 \n", + "1317 60 11 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "1249 70.037 875.09 \n", + "1024 68.762 3.79 \n", + "559 66.047 1020.38 \n", + "722 70.409 29817.20 \n", + "1317 67.749 1156.19 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "1249 1.13 False 70 \n", + "1024 1.02 False 75 \n", + "559 1.64 True 56 \n", + "722 1.09 False 74 \n", + "1317 1.13 False 67 " + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data.sample(5)" + ] + }, + { + "cell_type": "markdown", + "id": "3a3d1c17-1d5b-4ddf-aac3-78b8156ceca4", + "metadata": {}, + "source": [ + "#### Data Explorations: Streetlight" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "da10c3eb-31bd-437e-b546-82472d66f964", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1710" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(sl_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", + "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", + "
zone_idzone_namen
01005898592San Francisco – Oakland Bay Bridge / 8921938 / 190
11020456908San Francisco – Oakland Bay Bridge / 23874736 / 190
21022959400San Francisco – Oakland Bay Bridge / 661905446...90
31032819756San Francisco – Oakland Bay Bridge / 11415208 / 190
41036056766San Francisco – Oakland Bay Bridge / 52721870 / 190
51050419851San Francisco – Oakland Bay Bridge / 179235221...90
61093181568San Francisco – Oakland Bay Bridge / 50691047 / 190
71112052563San Francisco – Oakland Bay Bridge / 236348360...90
81112062603San Francisco – Oakland Bay Bridge / 236348361...90
91114495634I 80 / 395419317 / 190
101117259749San Francisco – Oakland Bay Bridge / 237731428...90
111118036302I 80 / 839972875 / 190
121120995048San Francisco – Oakland Bay Bridge / 497579295...90
131125811810I 80 / 839972874 / 190
141128174334San Francisco – Oakland Bay Bridge / 237731428...90
151130705657San Francisco – Oakland Bay Bridge / 52527662 / 190
161132861884I 80 / 236348365 / 190
171133975975San Francisco – Oakland Bay Bridge / 929579737...90
181135393455I 80 / 781148922 / 190
\n", + "
" + ], + "text/plain": [ + " zone_id zone_name n\n", + "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 90\n", + "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 90\n", + "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 90\n", + "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 90\n", + "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 90\n", + "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 90\n", + "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 90\n", + "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 90\n", + "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 90\n", + "9 1114495634 I 80 / 395419317 / 1 90\n", + "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 90\n", + "11 1118036302 I 80 / 839972875 / 1 90\n", + "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 90\n", + "13 1125811810 I 80 / 839972874 / 1 90\n", + "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 90\n", + "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 90\n", + "16 1132861884 I 80 / 236348365 / 1 90\n", + "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 90\n", + "18 1135393455 I 80 / 781148922 / 1 90" ] }, - "execution_count": 32, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4eccfdf8-429e-43df-899e-f7d77e051831", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c929c77d-0173-4a7d-be49-762349daf5cb", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ad574f5a-8780-443e-8a16-52387d0a1fb8", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "97f56b20-f299-43f5-bad4-2a42362962e2", - "metadata": {}, - "source": [ - "#### Read in Streetlight Data" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", - "metadata": {}, - "outputs": [], - "source": [ - "streetlight = \"streetlight_bay_bridge_corridor_study_corridor_study.csv\"" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", - "metadata": {}, - "outputs": [], - "source": [ - "sl_data = to_snakecase(pd.read_csv(f\"{GCS_PATH}{streetlight}\"))" + "sl_data>>count(_.zone_id, _.zone_name)" ] }, { "cell_type": "code", - "execution_count": 10, - "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", + "execution_count": 15, + "id": "cd1ce590-2019-43f0-ba09-786520479ad8", "metadata": {}, "outputs": [ { @@ -3128,247 +4565,251 @@ " \n", " \n", " \n", - " data_periods\n", - " mode_of_travel\n", - " zone_id\n", - " zone_name\n", - " road_classification\n", - " line_zone_length__miles_\n", - " zone_is_pass_through\n", - " zone_direction__degrees_\n", - " zone_cardinal_direction\n", - " zone_is_bi_direction\n", - " day_type\n", " day_part\n", - " average_daily_segment_traffic__stl_volume_\n", - " avg_segment_speed__mph_\n", - " avg_segment_travel_time__sec_\n", - " free_flow_speed__mph_\n", - " vehicle_miles_of_travel__stl_volume_\n", - " travel_time_index\n", - " congested_segment\n", - " _85th_speed_percentile\n", + " n\n", " \n", " \n", " \n", " \n", - " 1305\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428...\n", - " Motorway\n", - " 0.177\n", - " yes\n", - " 43\n", - " EAST\n", - " no\n", - " 1: Weekday (M-F)\n", - " 15: 11am (11am-12noon)\n", - " 8505\n", - " 58\n", - " 11\n", - " 67.749\n", - " 1504.04\n", - " 1.16\n", - " False\n", - " 66\n", + " 0\n", + " 00: All Day (12am-12am)\n", + " 3\n", " \n", " \n", - " 329\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1032819756\n", - " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", - " Motorway\n", - " 0.109\n", - " yes\n", - " 220\n", - " WEST\n", - " no\n", - " 1: Weekday (M-F)\n", - " 29: 11pm (11pm-12am)\n", - " 1824\n", - " 65\n", - " 7\n", - " 68.596\n", - " 199.30\n", - " 1.05\n", - " False\n", - " 74\n", + " 1\n", + " 01: 12am (12am-1am)\n", + " 3\n", " \n", " \n", - " 399\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1036056766\n", - " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", - " Motorway\n", - " 0.073\n", - " yes\n", - " 37\n", - " EAST\n", - " no\n", - " 1: Weekday (M-F)\n", + " 2\n", + " 02: Early AM (12am-6am)\n", + " 3\n", + " \n", + " \n", + " 3\n", + " 03: 1am (1am-2am)\n", + " 3\n", + " \n", + " \n", + " 4\n", + " 04: 2am (2am-3am)\n", + " 3\n", + " \n", + " \n", + " 5\n", + " 05: 3am (3am-4am)\n", + " 3\n", + " \n", + " \n", + " 6\n", + " 06: 4am (4am-5am)\n", + " 3\n", + " \n", + " \n", + " 7\n", + " 07: 5am (5am-6am)\n", + " 3\n", + " \n", + " \n", + " 8\n", + " 08: 6am (6am-7am)\n", + " 3\n", + " \n", + " \n", + " 9\n", " 09: Peak AM (6am-10am)\n", - " 24210\n", - " 59\n", " 3\n", - " 67.267\n", - " 1761.56\n", - " 1.14\n", - " False\n", - " 70\n", " \n", " \n", - " 644\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1112052563\n", - " San Francisco – Oakland Bay Bridge / 236348360...\n", - " Motorway\n", - " 0.054\n", - " yes\n", - " 231\n", - " WEST\n", - " no\n", - " 0: All Days (M-Su)\n", - " 14: Mid-Day (10am-4pm)\n", - " 44527\n", - " 52\n", + " 10\n", + " 10: 7am (7am-8am)\n", + " 3\n", + " \n", + " \n", + " 11\n", + " 11: 8am (8am-9am)\n", + " 3\n", + " \n", + " \n", + " 12\n", + " 12: 9am (9am-10am)\n", + " 3\n", + " \n", + " \n", + " 13\n", + " 13: 10am (10am-11am)\n", + " 3\n", + " \n", + " \n", + " 14\n", + " 14: Mid-Day (10am-4pm)\n", + " 3\n", + " \n", + " \n", + " 15\n", + " 15: 11am (11am-12noon)\n", + " 3\n", + " \n", + " \n", + " 16\n", + " 16: 12pm (12noon-1pm)\n", + " 3\n", + " \n", + " \n", + " 17\n", + " 17: 1pm (1pm-2pm)\n", + " 3\n", + " \n", + " \n", + " 18\n", + " 18: 2pm (2pm-3pm)\n", + " 3\n", + " \n", + " \n", + " 19\n", + " 19: 3pm (3pm-4pm)\n", + " 3\n", + " \n", + " \n", + " 20\n", + " 20: 4pm (4pm-5pm)\n", + " 3\n", + " \n", + " \n", + " 21\n", + " 21: Peak PM (4pm-8pm)\n", + " 3\n", + " \n", + " \n", + " 22\n", + " 22: 5pm (5pm-6pm)\n", + " 3\n", + " \n", + " \n", + " 23\n", + " 23: 6pm (6pm-7pm)\n", + " 3\n", + " \n", + " \n", + " 24\n", + " 24: 7pm (7pm-8pm)\n", + " 3\n", + " \n", + " \n", + " 25\n", + " 25: 8pm (8pm-9pm)\n", + " 3\n", + " \n", + " \n", + " 26\n", + " 26: Late PM (8pm-12am)\n", " 3\n", - " 69.248\n", - " 2387.11\n", - " 1.34\n", - " True\n", - " 66\n", " \n", " \n", - " 208\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1022959400\n", - " San Francisco – Oakland Bay Bridge / 661905446...\n", - " Motorway\n", - " 1.939\n", - " yes\n", - " 40\n", - " EAST\n", - " no\n", - " 0: All Days (M-Su)\n", + " 27\n", + " 27: 9pm (9pm-10pm)\n", + " 3\n", + " \n", + " \n", + " 28\n", " 28: 10pm (10pm-11pm)\n", - " 5492\n", - " 55\n", - " 128\n", - " 64.627\n", - " 10647.30\n", - " 1.17\n", - " False\n", - " 63\n", + " 3\n", + " \n", + " \n", + " 29\n", + " 29: 11pm (11pm-12am)\n", + " 3\n", " \n", " \n", "\n", "" ], "text/plain": [ - " data_periods \\\n", - "1305 Jan 01, 2022 - Dec 31, 2022 \n", - "329 Jan 01, 2022 - Dec 31, 2022 \n", - "399 Jan 01, 2022 - Dec 31, 2022 \n", - "644 Jan 01, 2022 - Dec 31, 2022 \n", - "208 Jan 01, 2022 - Dec 31, 2022 \n", - "\n", - " mode_of_travel zone_id \\\n", - "1305 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", - "329 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", - "399 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", - "644 All Vehicles CVD Plus - StL All Vehicles Volume 1112052563 \n", - "208 All Vehicles CVD Plus - StL All Vehicles Volume 1022959400 \n", - "\n", - " zone_name road_classification \\\n", - "1305 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", - "329 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", - "399 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", - "644 San Francisco – Oakland Bay Bridge / 236348360... Motorway \n", - "208 San Francisco – Oakland Bay Bridge / 661905446... Motorway \n", - "\n", - " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "1305 0.177 yes 43 \n", - "329 0.109 yes 220 \n", - "399 0.073 yes 37 \n", - "644 0.054 yes 231 \n", - "208 1.939 yes 40 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "1305 EAST no 1: Weekday (M-F) \n", - "329 WEST no 1: Weekday (M-F) \n", - "399 EAST no 1: Weekday (M-F) \n", - "644 WEST no 0: All Days (M-Su) \n", - "208 EAST no 0: All Days (M-Su) \n", - "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "1305 15: 11am (11am-12noon) 8505 \n", - "329 29: 11pm (11pm-12am) 1824 \n", - "399 09: Peak AM (6am-10am) 24210 \n", - "644 14: Mid-Day (10am-4pm) 44527 \n", - "208 28: 10pm (10pm-11pm) 5492 \n", - "\n", - " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "1305 58 11 \n", - "329 65 7 \n", - "399 59 3 \n", - "644 52 3 \n", - "208 55 128 \n", - "\n", - " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "1305 67.749 1504.04 \n", - "329 68.596 199.30 \n", - "399 67.267 1761.56 \n", - "644 69.248 2387.11 \n", - "208 64.627 10647.30 \n", - "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "1305 1.16 False 66 \n", - "329 1.05 False 74 \n", - "399 1.14 False 70 \n", - "644 1.34 True 66 \n", - "208 1.17 False 63 " + " day_part n\n", + "0 00: All Day (12am-12am) 3\n", + "1 01: 12am (12am-1am) 3\n", + "2 02: Early AM (12am-6am) 3\n", + "3 03: 1am (1am-2am) 3\n", + "4 04: 2am (2am-3am) 3\n", + "5 05: 3am (3am-4am) 3\n", + "6 06: 4am (4am-5am) 3\n", + "7 07: 5am (5am-6am) 3\n", + "8 08: 6am (6am-7am) 3\n", + "9 09: Peak AM (6am-10am) 3\n", + "10 10: 7am (7am-8am) 3\n", + "11 11: 8am (8am-9am) 3\n", + "12 12: 9am (9am-10am) 3\n", + "13 13: 10am (10am-11am) 3\n", + "14 14: Mid-Day (10am-4pm) 3\n", + "15 15: 11am (11am-12noon) 3\n", + "16 16: 12pm (12noon-1pm) 3\n", + "17 17: 1pm (1pm-2pm) 3\n", + "18 18: 2pm (2pm-3pm) 3\n", + "19 19: 3pm (3pm-4pm) 3\n", + "20 20: 4pm (4pm-5pm) 3\n", + "21 21: Peak PM (4pm-8pm) 3\n", + "22 22: 5pm (5pm-6pm) 3\n", + "23 23: 6pm (6pm-7pm) 3\n", + "24 24: 7pm (7pm-8pm) 3\n", + "25 25: 8pm (8pm-9pm) 3\n", + "26 26: Late PM (8pm-12am) 3\n", + "27 27: 9pm (9pm-10pm) 3\n", + "28 28: 10pm (10pm-11pm) 3\n", + "29 29: 11pm (11pm-12am) 3" ] }, - "execution_count": 10, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data.sample(5)" + "sl_data>>filter(_.zone_id==1133975975)>>count(_.day_part)" + ] + }, + { + "cell_type": "markdown", + "id": "5d362f46-cfe6-4d13-b3ea-67f491a66897", + "metadata": {}, + "source": [ + "* The data here shows that each segment is broken out into hour time slots and then also aggregated to peak time periods. moving forward we will look at the `All Day` for `day_part` and `All Days` for `day_type`" ] }, { "cell_type": "code", - "execution_count": 11, - "id": "da10c3eb-31bd-437e-b546-82472d66f964", + "execution_count": 16, + "id": "57c890a6-c667-4917-a090-b85f1aadcad7", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data_single_day = sl_data>>filter(_.day_part == '00: All Day (12am-12am)', _.day_type == '0: All Days (M-Su)')" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "0a059c82-c7c8-43b9-92a6-178b42101828", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "1710" + "19" ] }, - "execution_count": 11, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "len(sl_data)" + "len(sl_data_single_day)" ] }, { "cell_type": "code", - "execution_count": 17, - "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", + "execution_count": 18, + "id": "67213733-9905-42bd-912e-cf943cd66b40", "metadata": {}, "outputs": [ { @@ -3402,156 +4843,271 @@ " 0\n", " 1005898592\n", " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 1\n", " 1020456908\n", " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 2\n", " 1022959400\n", " San Francisco – Oakland Bay Bridge / 661905446...\n", - " 90\n", + " 1\n", " \n", " \n", " 3\n", " 1032819756\n", " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 4\n", " 1036056766\n", " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 5\n", " 1050419851\n", " San Francisco – Oakland Bay Bridge / 179235221...\n", - " 90\n", + " 1\n", " \n", " \n", " 6\n", " 1093181568\n", " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 7\n", " 1112052563\n", " San Francisco – Oakland Bay Bridge / 236348360...\n", - " 90\n", + " 1\n", " \n", " \n", " 8\n", " 1112062603\n", " San Francisco – Oakland Bay Bridge / 236348361...\n", - " 90\n", + " 1\n", " \n", " \n", " 9\n", " 1114495634\n", " I 80 / 395419317 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 10\n", " 1117259749\n", " San Francisco – Oakland Bay Bridge / 237731428...\n", - " 90\n", + " 1\n", " \n", " \n", " 11\n", " 1118036302\n", " I 80 / 839972875 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 12\n", " 1120995048\n", " San Francisco – Oakland Bay Bridge / 497579295...\n", - " 90\n", + " 1\n", " \n", " \n", " 13\n", " 1125811810\n", " I 80 / 839972874 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 14\n", " 1128174334\n", " San Francisco – Oakland Bay Bridge / 237731428...\n", - " 90\n", + " 1\n", " \n", " \n", " 15\n", " 1130705657\n", " San Francisco – Oakland Bay Bridge / 52527662 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 16\n", " 1132861884\n", " I 80 / 236348365 / 1\n", - " 90\n", + " 1\n", " \n", " \n", " 17\n", " 1133975975\n", " San Francisco – Oakland Bay Bridge / 929579737...\n", - " 90\n", + " 1\n", " \n", " \n", " 18\n", " 1135393455\n", " I 80 / 781148922 / 1\n", - " 90\n", + " 1\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " zone_id zone_name n\n", + "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 1\n", + "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 1\n", + "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 1\n", + "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 1\n", + "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 1\n", + "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 1\n", + "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 1\n", + "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 1\n", + "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 1\n", + "9 1114495634 I 80 / 395419317 / 1 1\n", + "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 1\n", + "11 1118036302 I 80 / 839972875 / 1 1\n", + "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 1\n", + "13 1125811810 I 80 / 839972874 / 1 1\n", + "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 1\n", + "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 1\n", + "16 1132861884 I 80 / 236348365 / 1 1\n", + "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 1\n", + "18 1135393455 I 80 / 781148922 / 1 1" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data_single_day>>count(_.zone_id, _.zone_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", + "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", "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
1530Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1133975975San Francisco – Oakland Bay Bridge / 929579737...Motorway0.273yes215WESTno0: All Days (M-Su)00: All Day (12am-12am)128139492368.63435038.31.39True67
\n", "
" ], "text/plain": [ - " zone_id zone_name n\n", - "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 90\n", - "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 90\n", - "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 90\n", - "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 90\n", - "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 90\n", - "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 90\n", - "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 90\n", - "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 90\n", - "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 90\n", - "9 1114495634 I 80 / 395419317 / 1 90\n", - "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 90\n", - "11 1118036302 I 80 / 839972875 / 1 90\n", - "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 90\n", - "13 1125811810 I 80 / 839972874 / 1 90\n", - "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 90\n", - "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 90\n", - "16 1132861884 I 80 / 236348365 / 1 90\n", - "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 90\n", - "18 1135393455 I 80 / 781148922 / 1 90" + " data_periods \\\n", + "1530 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "1530 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", + "\n", + " zone_name road_classification \\\n", + "1530 San Francisco – Oakland Bay Bridge / 929579737... Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "1530 0.273 yes 215 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "1530 WEST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1530 00: All Day (12am-12am) 128139 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "1530 49 23 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "1530 68.634 35038.3 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "1530 1.39 True 67 " ] }, - "execution_count": 17, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data>>count(_.zone_id, _.zone_name)" + "sl_data_single_day>>filter(_.zone_id==1133975975)" ] }, { "cell_type": "code", - "execution_count": 19, - "id": "cd1ce590-2019-43f0-ba09-786520479ad8", + "execution_count": 22, + "id": "28292f62-b2ab-46cb-ac08-b728facdfdc0", "metadata": {}, "outputs": [ { @@ -3575,251 +5131,323 @@ " \n", " \n", " \n", + " data_periods\n", + " mode_of_travel\n", + " zone_id\n", + " zone_name\n", + " road_classification\n", + " line_zone_length__miles_\n", + " zone_is_pass_through\n", + " zone_direction__degrees_\n", + " zone_cardinal_direction\n", + " zone_is_bi_direction\n", + " day_type\n", " day_part\n", - " n\n", + " average_daily_segment_traffic__stl_volume_\n", + " avg_segment_speed__mph_\n", + " avg_segment_travel_time__sec_\n", + " free_flow_speed__mph_\n", + " vehicle_miles_of_travel__stl_volume_\n", + " travel_time_index\n", + " congested_segment\n", + " _85th_speed_percentile\n", " \n", " \n", " \n", " \n", - " 0\n", + " 450\n", + " Jan 01, 2022 - Dec 31, 2022\n", + " All Vehicles CVD Plus - StL All Vehicles Volume\n", + " 1050419851\n", + " San Francisco – Oakland Bay Bridge / 179235221...\n", + " Motorway\n", + " 0.004\n", + " yes\n", + " 38\n", + " EAST\n", + " no\n", + " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 3\n", - " \n", - " \n", - " 1\n", - " 01: 12am (12am-1am)\n", - " 3\n", - " \n", - " \n", - " 2\n", - " 02: Early AM (12am-6am)\n", - " 3\n", - " \n", - " \n", - " 3\n", - " 03: 1am (1am-2am)\n", - " 3\n", - " \n", - " \n", - " 4\n", - " 04: 2am (2am-3am)\n", - " 3\n", - " \n", - " \n", - " 5\n", - " 05: 3am (3am-4am)\n", - " 3\n", - " \n", - " \n", - " 6\n", - " 06: 4am (4am-5am)\n", - " 3\n", - " \n", - " \n", - " 7\n", - " 07: 5am (5am-6am)\n", - " 3\n", - " \n", - " \n", - " 8\n", - " 08: 6am (6am-7am)\n", - " 3\n", - " \n", - " \n", - " 9\n", - " 09: Peak AM (6am-10am)\n", - " 3\n", - " \n", - " \n", - " 10\n", - " 10: 7am (7am-8am)\n", - " 3\n", - " \n", - " \n", - " 11\n", - " 11: 8am (8am-9am)\n", - " 3\n", - " \n", - " \n", - " 12\n", - " 12: 9am (9am-10am)\n", - " 3\n", - " \n", - " \n", - " 13\n", - " 13: 10am (10am-11am)\n", - " 3\n", - " \n", - " \n", - " 14\n", - " 14: Mid-Day (10am-4pm)\n", - " 3\n", - " \n", - " \n", - " 15\n", - " 15: 11am (11am-12noon)\n", - " 3\n", - " \n", - " \n", - " 16\n", - " 16: 12pm (12noon-1pm)\n", - " 3\n", - " \n", - " \n", - " 17\n", - " 17: 1pm (1pm-2pm)\n", - " 3\n", - " \n", - " \n", - " 18\n", - " 18: 2pm (2pm-3pm)\n", - " 3\n", - " \n", - " \n", - " 19\n", - " 19: 3pm (3pm-4pm)\n", - " 3\n", - " \n", - " \n", - " 20\n", - " 20: 4pm (4pm-5pm)\n", - " 3\n", - " \n", - " \n", - " 21\n", - " 21: Peak PM (4pm-8pm)\n", - " 3\n", - " \n", - " \n", - " 22\n", - " 22: 5pm (5pm-6pm)\n", - " 3\n", - " \n", - " \n", - " 23\n", - " 23: 6pm (6pm-7pm)\n", - " 3\n", - " \n", - " \n", - " 24\n", - " 24: 7pm (7pm-8pm)\n", - " 3\n", + " 161170\n", + " 53\n", + " 2\n", + " 67.840\n", + " 695.17\n", + " 1.29\n", + " True\n", + " 67\n", " \n", " \n", - " 25\n", - " 25: 8pm (8pm-9pm)\n", - " 3\n", + " 540\n", + " Jan 01, 2022 - Dec 31, 2022\n", + " All Vehicles CVD Plus - StL All Vehicles Volume\n", + " 1093181568\n", + " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", + " Motorway\n", + " 0.109\n", + " yes\n", + " 40\n", + " EAST\n", + " no\n", + " 0: All Days (M-Su)\n", + " 00: All Day (12am-12am)\n", + " 133795\n", + " 51\n", + " 8\n", + " 66.047\n", + " 14579.50\n", + " 1.30\n", + " True\n", + " 64\n", " \n", " \n", - " 26\n", - " 26: Late PM (8pm-12am)\n", - " 3\n", + " 0\n", + " Jan 01, 2022 - Dec 31, 2022\n", + " All Vehicles CVD Plus - StL All Vehicles Volume\n", + " 1005898592\n", + " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", + " Motorway\n", + " 1.985\n", + " yes\n", + " 220\n", + " WEST\n", + " no\n", + " 0: All Days (M-Su)\n", + " 00: All Day (12am-12am)\n", + " 108456\n", + " 44\n", + " 179\n", + " 66.336\n", + " 215328.00\n", + " 1.50\n", + " True\n", + " 63\n", " \n", - " \n", - " 27\n", - " 27: 9pm (9pm-10pm)\n", - " 3\n", + " \n", + "\n", + "" + ], + "text/plain": [ + " data_periods \\\n", + "450 Jan 01, 2022 - Dec 31, 2022 \n", + "540 Jan 01, 2022 - Dec 31, 2022 \n", + "0 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "450 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", + "540 All Vehicles CVD Plus - StL All Vehicles Volume 1093181568 \n", + "0 All Vehicles CVD Plus - StL All Vehicles Volume 1005898592 \n", + "\n", + " zone_name road_classification \\\n", + "450 San Francisco – Oakland Bay Bridge / 179235221... Motorway \n", + "540 San Francisco – Oakland Bay Bridge / 50691047 / 1 Motorway \n", + "0 San Francisco – Oakland Bay Bridge / 8921938 / 1 Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "450 0.004 yes 38 \n", + "540 0.109 yes 40 \n", + "0 1.985 yes 220 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "450 EAST no 0: All Days (M-Su) \n", + "540 EAST no 0: All Days (M-Su) \n", + "0 WEST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "450 00: All Day (12am-12am) 161170 \n", + "540 00: All Day (12am-12am) 133795 \n", + "0 00: All Day (12am-12am) 108456 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "450 53 2 \n", + "540 51 8 \n", + "0 44 179 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "450 67.840 695.17 \n", + "540 66.047 14579.50 \n", + "0 66.336 215328.00 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "450 1.29 True 67 \n", + "540 1.30 True 64 \n", + "0 1.50 True 63 " + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_data_single_day.sample(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", + "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", "
zone_cardinal_directionday_typeday_partavg_speedavg_travel_timeavg_volumesum_volume
2828: 10pm (10pm-11pm)30EAST0: All Days (M-Su)00: All Day (12am-12am)55.90000032.600000139682.3000001396823
2929: 11pm (11pm-12am)31WEST0: All Days (M-Su)00: All Day (12am-12am)50.33333341.777778123029.7777781107268
\n", "
" ], "text/plain": [ - " day_part n\n", - "0 00: All Day (12am-12am) 3\n", - "1 01: 12am (12am-1am) 3\n", - "2 02: Early AM (12am-6am) 3\n", - "3 03: 1am (1am-2am) 3\n", - "4 04: 2am (2am-3am) 3\n", - "5 05: 3am (3am-4am) 3\n", - "6 06: 4am (4am-5am) 3\n", - "7 07: 5am (5am-6am) 3\n", - "8 08: 6am (6am-7am) 3\n", - "9 09: Peak AM (6am-10am) 3\n", - "10 10: 7am (7am-8am) 3\n", - "11 11: 8am (8am-9am) 3\n", - "12 12: 9am (9am-10am) 3\n", - "13 13: 10am (10am-11am) 3\n", - "14 14: Mid-Day (10am-4pm) 3\n", - "15 15: 11am (11am-12noon) 3\n", - "16 16: 12pm (12noon-1pm) 3\n", - "17 17: 1pm (1pm-2pm) 3\n", - "18 18: 2pm (2pm-3pm) 3\n", - "19 19: 3pm (3pm-4pm) 3\n", - "20 20: 4pm (4pm-5pm) 3\n", - "21 21: Peak PM (4pm-8pm) 3\n", - "22 22: 5pm (5pm-6pm) 3\n", - "23 23: 6pm (6pm-7pm) 3\n", - "24 24: 7pm (7pm-8pm) 3\n", - "25 25: 8pm (8pm-9pm) 3\n", - "26 26: Late PM (8pm-12am) 3\n", - "27 27: 9pm (9pm-10pm) 3\n", - "28 28: 10pm (10pm-11pm) 3\n", - "29 29: 11pm (11pm-12am) 3" + " zone_cardinal_direction day_type day_part \\\n", + "0 EAST 0: All Days (M-Su) 00: All Day (12am-12am) \n", + "1 WEST 0: All Days (M-Su) 00: All Day (12am-12am) \n", + "\n", + " avg_speed avg_travel_time avg_volume sum_volume \n", + "0 55.900000 32.600000 139682.300000 1396823 \n", + "1 50.333333 41.777778 123029.777778 1107268 " ] }, - "execution_count": 19, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data>>filter(_.zone_id==1133975975)>>count(_.day_part)" + "sl_data_single_day>>group_by(_.zone_cardinal_direction, _.day_type, _.day_part)>>summarize(avg_speed= _.avg_segment_speed__mph_.mean(),\n", + " avg_travel_time = _.avg_segment_travel_time__sec_.mean(),\n", + " avg_volume = _.average_daily_segment_traffic__stl_volume_.mean(),\n", + " sum_volume = _.average_daily_segment_traffic__stl_volume_.sum())" ] }, { - "cell_type": "markdown", - "id": "5d362f46-cfe6-4d13-b3ea-67f491a66897", + "cell_type": "code", + "execution_count": 38, + "id": "778d58f0-25b7-4cf7-b60a-10e773055f48", "metadata": {}, + "outputs": [], "source": [ - "* The data here shows that each segment is broken out into hour time slots and then also aggregated to peak time periods. moving forward we will look at the `All Day` for `day_part` and `All Days` for `day_type`" + "sl_peaks = (sl_data>>filter(\n", + " _.day_part != \"01: 12am (12am-1am)\",\n", + " _.day_part != \"03: 1am (1am-2am)\",\n", + " _.day_part != \"04: 2am (2am-3am)\",\n", + " _.day_part != \"05: 3am (3am-4am)\",\n", + " _.day_part != \"06: 4am (4am-5am)\",\n", + " _.day_part != \"07: 5am (5am-6am)\",\n", + " _.day_part != \"08: 6am (6am-7am)\",\n", + " _.day_part != \"10: 7am (7am-8am)\",\n", + " _.day_part != \"11: 8am (8am-9am)\",\n", + " _.day_part != \"12: 9am (9am-10am)\",\n", + " _.day_part != \"13: 10am (10am-11am)\",\n", + " _.day_part != \"15: 11am (11am-12noon)\",\n", + " _.day_part != \"16: 12pm (12noon-1pm)\",\n", + " _.day_part != \"17: 1pm (1pm-2pm)\",\n", + " _.day_part != \"18: 2pm (2pm-3pm)\",\n", + " _.day_part != \"19: 3pm (3pm-4pm)\",\n", + " _.day_part != \"20: 4pm (4pm-5pm)\",\n", + " _.day_part != \"22: 5pm (5pm-6pm)\",\n", + " _.day_part != \"23: 6pm (6pm-7pm)\",\n", + " _.day_part != \"24: 7pm (7pm-8pm)\",\n", + " _.day_part != \"25: 8pm (8pm-9pm)\",\n", + " _.day_part != \"27: 9pm (9pm-10pm)\",\n", + " _.day_part != \"28: 10pm (10pm-11pm)\",\n", + " _.day_part !=\"29: 11pm (11pm-12am)\"))" ] }, { "cell_type": "code", - "execution_count": 24, - "id": "57c890a6-c667-4917-a090-b85f1aadcad7", + "execution_count": null, + "id": "2f2fa572-8bb8-4b9f-a299-48df2b838c31", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "29eab191-4eaa-445c-b444-49048135ef3b", "metadata": {}, "outputs": [], "source": [ - "sl_data = sl_data>>filter(_.day_part == '00: All Day (12am-12am)', _.day_type == '0: All Days (M-Su)')" + "sl_hourly = (sl_data>>filter(_.day_part != \"00: All Day (12am-12am)\",\n", + " _.day_part != \"02: Early AM (12am-6am)\",\n", + " _.day_part != \"09: Peak AM (6am-10am)\",\n", + " _.day_part != \"14: Mid-Day (10am-4pm)\",\n", + " _.day_part != \"21: Peak PM (4pm-8pm)\", _.day_part !=\"26: Late PM (8pm-12am)\"))" ] }, { "cell_type": "code", - "execution_count": 27, - "id": "0a059c82-c7c8-43b9-92a6-178b42101828", + "execution_count": null, + "id": "4cd2a638-cce1-4c94-8444-4aa4844bf7f0", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "19" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "896b63a9-b881-418a-ba40-dbea63f81614", + "metadata": {}, + "outputs": [], "source": [ - "len(sl_data)" + "sl_peaks_agg = sl_peaks>>group_by(_.zone_cardinal_direction,\n", + " _.day_type, _.day_part)>>summarize(avg_speed= _.avg_segment_speed__mph_.mean(),\n", + " avg_travel_time = _.avg_segment_travel_time__sec_.mean(),\n", + " avg_volume = _.average_daily_segment_traffic__stl_volume_.mean(),\n", + " sum_volume = _.average_daily_segment_traffic__stl_volume_.sum())" ] }, { "cell_type": "code", - "execution_count": 28, - "id": "67213733-9905-42bd-912e-cf943cd66b40", + "execution_count": 154, + "id": "cac29684-36ac-488b-b2d1-044ab5ef86c0", "metadata": {}, "outputs": [ { @@ -3835,174 +5463,305 @@ " vertical-align: top;\n", " }\n", "\n", - " .dataframe thead th {\n", - " text-align: right;\n", - " }\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "\n", + "
zone_idzone_namen
01005898592San Francisco – Oakland Bay Bridge / 8921938 / 11
11020456908San Francisco – Oakland Bay Bridge / 23874736 / 11
21022959400San Francisco – Oakland Bay Bridge / 661905446...1
31032819756San Francisco – Oakland Bay Bridge / 11415208 / 11
41036056766San Francisco – Oakland Bay Bridge / 52721870 / 11
51050419851San Francisco – Oakland Bay Bridge / 179235221...1
61093181568San Francisco – Oakland Bay Bridge / 50691047 / 11
71112052563San Francisco – Oakland Bay Bridge / 236348360...1
81112062603San Francisco – Oakland Bay Bridge / 236348361...1
91114495634I 80 / 395419317 / 11
101117259749San Francisco – Oakland Bay Bridge / 237731428...1
111118036302I 80 / 839972875 / 11
121120995048San Francisco – Oakland Bay Bridge / 497579295...1
131125811810I 80 / 839972874 / 11
141128174334San Francisco – Oakland Bay Bridge / 237731428...1
151130705657San Francisco – Oakland Bay Bridge / 52527662 / 11
161132861884I 80 / 236348365 / 11
171133975975San Francisco – Oakland Bay Bridge / 929579737...1
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
zone_cardinal_directionday_typeday_partavg_speedavg_travel_timeavg_volumesum_volume
181135393455I 80 / 781148922 / 1134WEST2: Weekend Day (Sa-Su)21: Peak PM (4pm-8pm)40.22222254.22222223846.222222214616
\n", "" ], "text/plain": [ - " zone_id zone_name n\n", - "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 1\n", - "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 1\n", - "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446... 1\n", - "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 1\n", - "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 1\n", - "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221... 1\n", - "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 1\n", - "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360... 1\n", - "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361... 1\n", - "9 1114495634 I 80 / 395419317 / 1 1\n", - "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428... 1\n", - "11 1118036302 I 80 / 839972875 / 1 1\n", - "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295... 1\n", - "13 1125811810 I 80 / 839972874 / 1 1\n", - "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428... 1\n", - "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 1\n", - "16 1132861884 I 80 / 236348365 / 1 1\n", - "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737... 1\n", - "18 1135393455 I 80 / 781148922 / 1 1" + " zone_cardinal_direction day_type day_part \\\n", + "34 WEST 2: Weekend Day (Sa-Su) 21: Peak PM (4pm-8pm) \n", + "\n", + " avg_speed avg_travel_time avg_volume sum_volume \n", + "34 40.222222 54.222222 23846.222222 214616 " ] }, - "execution_count": 28, + "execution_count": 154, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data>>count(_.zone_id, _.zone_name)" + "sl_peaks_agg.sample()" ] }, { "cell_type": "code", - "execution_count": 25, - "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", + "execution_count": 157, + "id": "637afffc-560f-4485-985a-d6ee73dd65a7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 157, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(sl_peaks_agg)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"day_part\"),\n", + " y=alt.Y(\"avg_speed\"),\n", + " color=alt.Color(\"zone_cardinal_direction\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=sl_peaks_agg[\"zone_cardinal_direction\"].unique().tolist())\n", + " ),\n", + " tooltip=sl_peaks_agg.columns.tolist(),\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 155, + "id": "2c732efc-ddb0-4a85-83ea-f7667611b973", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 155, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(sl_peaks_agg)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"day_part\"),\n", + " y=alt.Y(\"avg_speed\"),\n", + " color=alt.Color(\"zone_cardinal_direction\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=sl_peaks_agg[\"zone_cardinal_direction\"].unique().tolist())\n", + " ),\n", + " tooltip=sl_peaks_agg.columns.tolist(),\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eedc968c-8306-449a-a2e3-774719d8e256", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6dade438-083b-446d-b1f7-d1542a3e60e6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7d954475-9f22-418b-bb31-0ab9799a459e", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "b2eaa07a-2d05-4ed5-a405-a474500a643e", + "metadata": {}, + "outputs": [], + "source": [ + "sl_hourly_agg = sl_hourly>>filter(_.day_type==\"0: All Days (M-Su)\")>>group_by(_.zone_cardinal_direction,\n", + " _.day_type, _.day_part)>>summarize(avg_speed= _.avg_segment_speed__mph_.mean(),\n", + " avg_travel_time = _.avg_segment_travel_time__sec_.mean(),\n", + " avg_volume = _.average_daily_segment_traffic__stl_volume_.mean(),\n", + " sum_volume = _.average_daily_segment_traffic__stl_volume_.sum())" + ] + }, + { + "cell_type": "code", + "execution_count": 153, + "id": "1ab3835d-5f8e-4721-9c29-7bd107bad334", "metadata": {}, "outputs": [ { @@ -4026,98 +5785,275 @@ " \n", " \n", " \n", - " data_periods\n", - " mode_of_travel\n", - " zone_id\n", - " zone_name\n", - " road_classification\n", - " line_zone_length__miles_\n", - " zone_is_pass_through\n", - " zone_direction__degrees_\n", " zone_cardinal_direction\n", - " zone_is_bi_direction\n", " day_type\n", " day_part\n", - " average_daily_segment_traffic__stl_volume_\n", - " avg_segment_speed__mph_\n", - " avg_segment_travel_time__sec_\n", - " free_flow_speed__mph_\n", - " vehicle_miles_of_travel__stl_volume_\n", - " travel_time_index\n", - " congested_segment\n", - " _85th_speed_percentile\n", + " avg_speed\n", + " avg_travel_time\n", + " avg_volume\n", + " sum_volume\n", " \n", " \n", " \n", " \n", - " 1530\n", - " Jan 01, 2022 - Dec 31, 2022\n", - " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1133975975\n", - " San Francisco – Oakland Bay Bridge / 929579737...\n", - " Motorway\n", - " 0.273\n", - " yes\n", - " 215\n", - " WEST\n", - " no\n", + " 3\n", + " EAST\n", " 0: All Days (M-Su)\n", - " 00: All Day (12am-12am)\n", - " 128139\n", - " 49\n", - " 23\n", - " 68.634\n", - " 35038.3\n", - " 1.39\n", - " True\n", - " 67\n", + " 05: 3am (3am-4am)\n", + " 66.7\n", + " 25.6\n", + " 741.0\n", + " 7410\n", " \n", " \n", "\n", "" ], "text/plain": [ - " data_periods \\\n", - "1530 Jan 01, 2022 - Dec 31, 2022 \n", + " zone_cardinal_direction day_type day_part avg_speed \\\n", + "3 EAST 0: All Days (M-Su) 05: 3am (3am-4am) 66.7 \n", "\n", - " mode_of_travel zone_id \\\n", - "1530 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", + " avg_travel_time avg_volume sum_volume \n", + "3 25.6 741.0 7410 " + ] + }, + "execution_count": 153, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl_hourly_agg.sample()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10efa809-ec77-4127-aa62-a838dd005c7d", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 151, + "id": "8cc145e6-b3d9-4b31-9a0d-270431ebf5fb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ "\n", - " zone_name road_classification \\\n", - "1530 San Francisco – Oakland Bay Bridge / 929579737... Motorway \n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 151, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(sl_hourly_agg)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"day_part\"),\n", + " y=alt.Y(\"avg_speed\"),\n", + " color=alt.Color(\"zone_cardinal_direction\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=sl_hourly_agg[\"zone_cardinal_direction\"].unique().tolist())\n", + " ),\n", + " tooltip=sl_hourly_agg.columns.tolist(),\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "id": "b54b867c-d073-4280-bfd3-2fa5bd387016", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "1530 1.39 True 67 " + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" ] }, - "execution_count": 25, + "execution_count": 152, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data>>filter(_.zone_id==1133975975)" + "chart = (\n", + " alt.Chart(sl_hourly_agg)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"day_part\"),\n", + " y=alt.Y(\"sum_volume\"),\n", + " color=alt.Color(\"zone_cardinal_direction\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=sl_hourly_agg[\"zone_cardinal_direction\"].unique().tolist())\n", + " ),\n", + " tooltip=sl_hourly_agg.columns.tolist(),\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " ] }, { "cell_type": "code", "execution_count": null, - "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", + "id": "cd1987e0-957e-4b30-a940-86f3c9c0fd39", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "76157cad-aeda-4ba4-9f98-77c677e6b6c6", "metadata": {}, "outputs": [], "source": [] From e58bfbbe7499d8f9de4da87aa173564924b9950b Mon Sep 17 00:00:00 2001 From: natam1 Date: Tue, 19 Mar 2024 15:45:35 +0000 Subject: [PATCH 03/16] add in people dataset --- .../corridor_study/data_downloads.ipynb | 4657 +++++++---------- 1 file changed, 1805 insertions(+), 2852 deletions(-) diff --git a/sb125_analyses/corridor_study/data_downloads.ipynb b/sb125_analyses/corridor_study/data_downloads.ipynb index 8dbc1e8a4..6d482bc8b 100644 --- a/sb125_analyses/corridor_study/data_downloads.ipynb +++ b/sb125_analyses/corridor_study/data_downloads.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 1, "id": "45233485-2055-499a-a89e-fc154fd56e63", "metadata": {}, "outputs": [], @@ -66,6 +66,24 @@ { "cell_type": "code", "execution_count": 5, + "id": "b0bd67f0-6f82-4f2c-8da0-3627a2813571", + "metadata": {}, + "outputs": [], + "source": [ + "replica_ppl = \"replica-bay_bridge-03_06_24-people_dataset.csv\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a9f14685-0953-4b1d-a636-882230fef1d5", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 6, "id": "cb3dea26-4e6d-4dc7-acc8-27b899a0a537", "metadata": {}, "outputs": [ @@ -73,7 +91,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_339/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_265/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))\n" ] } @@ -84,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "4713b1a5-ccac-4e1b-8552-850285cad53e", "metadata": {}, "outputs": [ @@ -165,441 +183,427 @@ " \n", " \n", " \n", - " 267500\n", - " multi_family\n", - " 53\n", - " english\n", - " 302.01 (San Francisco, CA)\n", - " 2981999124390393386\n", - " male\n", - " 3 (Tract 302.01, San Francisco, CA)\n", - " California\n", - " California\n", - " two_races_not_hispanic_or_latino\n", + " 341883\n", + " unknown\n", + " 37\n", + " NaN\n", + " 2512 (Solano, CA)\n", + " \n", " NaN\n", " NaN\n", - " core\n", - " unknown_vehicle_type\n", - " 27.0\n", - " 16597255654725327963\n", - " 1 (Tract 4222, Alameda, CA)\n", - " single_family\n", - " employed_not_working\n", " California\n", - " Alameda\n", - " 3 (Tract 302.01, San Francisco, CA)\n", - " 4222 (Alameda, CA)\n", - " 284387.0\n", - " 3 (Tract 302.01, San Francisco, CA)\n", - " worked_from_home\n", - " three_plus\n", - " auto_passenger\n", - " home\n", - " single_family\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " medium_commercial\n", + " NaN\n", + " 8804416068045243289\n", + " 1 (Tract 9809, San Francisco, CA)\n", + " unknown\n", " NaN\n", " California\n", - " 3.0\n", " San Francisco\n", - " single_family\n", - " not_working\n", - " renter\n", + " NaN\n", + " 9809 (San Francisco, CA)\n", + " NaN\n", + " 3 (Tract 2512, Solano, CA)\n", + " NaN\n", + " NaN\n", + " commercial\n", + " commercial\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " Solano\n", + " unknown\n", + " NaN\n", + " NaN\n", " unknown_fuel_type\n", - " 302.01 (San Francisco, CA)\n", - " 302.01 (San Francisco, CA)\n", - " bachelors_degree\n", - " 08:04:00\n", - " 94781.0\n", - " employed\n", - " school\n", - " multi_family\n", - " San Francisco\n", - " 21.4\n", - " not_attending_school\n", - " San Francisco\n", - " 114523536752271314\n", - " 08:57:16\n", + " NaN\n", + " NaN\n", + " NaN\n", + " 11:53:12\n", + " NaN\n", + " NaN\n", + " commercial\n", + " unknown\n", + " NaN\n", + " 32.7\n", + " NaN\n", + " NaN\n", + " \n", + " 12:31:00\n", " \n", " \n", - " 318811\n", - " education\n", - " 51\n", - " GQ_language\n", - " 179.03 (San Francisco, CA)\n", - " 294769040967747866\n", + " 447416\n", + " retail\n", + " 42\n", + " indo_european\n", + " 117 (San Francisco, CA)\n", + " 3356014983482410625\n", " male\n", - " 1 (Tract 179.03, San Francisco, CA)\n", + " 4 (Tract 3373, Contra Costa, CA)\n", " California\n", " California\n", - " hispanic_or_latino_origin\n", + " asian_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 19.0\n", - " 7487019993558144384\n", - " 2 (Tract 3131.04, Contra Costa, CA)\n", - " office\n", - " unemployed_under_16_not_in_labor_force\n", + " 70.0\n", + " 18257242654773494745\n", + " 4 (Tract 3373, Contra Costa, CA)\n", + " single_family\n", + " in_person\n", " California\n", " Contra Costa\n", - " Does not have work/school location\n", - " 3131.04 (Contra Costa, CA)\n", - " 0.0\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " other_travel_mode\n", - " unknown_num_vehicles\n", + " 3 (Tract 117, San Francisco, CA)\n", + " 3373 (Contra Costa, CA)\n", + " 284542.0\n", + " 3 (Tract 117, San Francisco, CA)\n", " private_auto\n", - " home\n", - " GQ_structure\n", + " two\n", + " private_auto\n", + " work\n", + " single_family\n", " NaN\n", - " Does not have work/school location\n", - " 1.0\n", + " California\n", + " 2.0\n", " San Francisco\n", - " office\n", - " not_working\n", - " GQ\n", + " single_family\n", + " naics4238\n", + " owner\n", " other_non_bev\n", - " 179.03 (San Francisco, CA)\n", - " Does not have work/school location\n", - " high_school\n", - " 14:07:00\n", - " 0.0\n", - " not_in_labor_force\n", - " maintenance\n", - " education\n", - " Does not have work/school location\n", - " 35.2\n", - " not_attending_school\n", + " 3373 (Contra Costa, CA)\n", + " 117 (San Francisco, CA)\n", + " some_college\n", + " 13:48:00\n", + " 150299.0\n", + " employed\n", + " home\n", + " mixed_use\n", " San Francisco\n", - " 6449342572168120247\n", - " 14:58:48\n", + " 28.0\n", + " not_attending_school\n", + " Contra Costa\n", + " 15153874493862167257\n", + " 14:30:04\n", " \n", " \n", - " 127266\n", - " multi_family\n", - " 183\n", - " english\n", - " 102.01 (San Francisco, CA)\n", - " 2007494479315805918\n", - " female\n", - " 2 (Tract 102.01, San Francisco, CA)\n", + " 220591\n", + " civic_institutional\n", + " 51\n", + " indo_european\n", + " 4033.02 (Alameda, CA)\n", + " 5359921280509092684\n", + " male\n", + " 2 (Tract 3451.13, Contra Costa, CA)\n", " California\n", " California\n", - " hispanic_or_latino_origin\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 28.0\n", - " 14874947884140784827\n", - " 2 (Tract 12.09, Nevada, CA)\n", - " retail\n", - " employed_not_working\n", + " 36.0\n", + " 6356762796714467304\n", + " 1 (Tract 9843, San Mateo, CA)\n", + " transportation_utilities\n", + " in_person\n", " California\n", - " Nevada\n", - " 1 (Tract 2014.01, Napa, CA)\n", - " 12.09 (Nevada, CA)\n", - " 327465.0\n", - " 2 (Tract 102.01, San Francisco, CA)\n", - " private_auto\n", - " three_plus\n", + " San Mateo\n", + " 2 (Tract 4033.02, Alameda, CA)\n", + " 9843 (San Mateo, CA)\n", + " 143541.0\n", + " 2 (Tract 4033.02, Alameda, CA)\n", + " public_transit\n", + " two\n", " auto_passenger\n", - " home\n", - " multiple_units\n", + " work\n", + " single_family\n", " NaN\n", " California\n", - " 3.0\n", - " San Francisco\n", - " retail\n", - " naics3399\n", - " renter\n", + " 5.0\n", + " Alameda\n", + " mixed_use\n", + " naics92\n", + " owner\n", " unknown_fuel_type\n", - " 102.01 (San Francisco, CA)\n", - " 2014.01 (Napa, CA)\n", - " bachelors_degree\n", - " 09:02:00\n", - " 111762.0\n", + " 3451.13 (Contra Costa, CA)\n", + " 4033.02 (Alameda, CA)\n", + " some_college\n", + " 10:45:00\n", + " 108472.0\n", " employed\n", - " shop\n", - " multi_family\n", - " Napa\n", - " 185.6\n", + " other_activity_type\n", + " civic_institutional\n", + " Alameda\n", + " 24.0\n", " not_attending_school\n", - " San Francisco\n", - " 15665869551117189445\n", - " 12:05:47\n", + " Contra Costa\n", + " 6603722051605389622\n", + " 11:36:05\n", " \n", " \n", - " 309112\n", + " 258399\n", " retail\n", - " 28\n", - " spanish\n", - " 6022.02 (San Mateo, CA)\n", - " 12449373272305106079\n", - " male\n", - " 2 (Tract 3810, Contra Costa, CA)\n", + " 52\n", + " english\n", + " 3080.02 (Contra Costa, CA)\n", + " 3127751141200174941\n", + " female\n", + " 1 (Tract 254.01, San Francisco, CA)\n", " California\n", " California\n", - " hispanic_or_latino_origin\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 26.0\n", - " 12179224938804524534\n", - " 2 (Tract 3810, Contra Costa, CA)\n", - " multi_family\n", - " unemployed_under_16_not_in_labor_force\n", + " 42.0\n", + " 7746586353797969666\n", + " 2 (Tract 6023, San Mateo, CA)\n", + " retail\n", + " remote\n", " California\n", - " Contra Costa\n", - " Does not have work/school location\n", - " 3810 (Contra Costa, CA)\n", - " 0.0\n", - " 1 (Tract 6022.02, San Mateo, CA)\n", - " other_travel_mode\n", - " three_plus\n", + " San Mateo\n", + " 3 (Tract 254.01, San Francisco, CA)\n", + " 6023 (San Mateo, CA)\n", + " 315157.0\n", + " 2 (Tract 3080.02, Contra Costa, CA)\n", + " worked_from_home\n", + " two\n", " auto_passenger\n", - " work\n", + " eat\n", " several_units\n", " NaN\n", - " Does not have work/school location\n", - " 2.0\n", - " San Mateo\n", - " multi_family\n", - " not_working\n", + " California\n", + " 4.0\n", + " Contra Costa\n", + " retail\n", + " naics42\n", " renter\n", " unknown_fuel_type\n", - " 3810 (Contra Costa, CA)\n", - " Does not have work/school location\n", - " some_college\n", - " 10:27:00\n", - " 0.0\n", - " not_in_labor_force\n", - " home\n", + " 254.01 (San Francisco, CA)\n", + " 254.01 (San Francisco, CA)\n", + " advanced_degree\n", + " 20:25:00\n", + " 135950.0\n", + " employed\n", + " shop\n", " retail\n", - " Does not have work/school location\n", - " 24.2\n", + " San Francisco\n", + " 53.1\n", " not_attending_school\n", - " Contra Costa\n", - " 2304317130050975816\n", - " 10:55:45\n", + " San Francisco\n", + " 11739595174551995701\n", + " 21:17:29\n", " \n", " \n", - " 199784\n", - " single_family\n", - " 48\n", - " indo_european\n", - " 4507.51 (Alameda, CA)\n", - " 14382520070638101596\n", - " female\n", - " 2 (Tract 4507.51, Alameda, CA)\n", + " 561394\n", + " industrial\n", + " 73\n", + " english\n", + " 168.01 (San Francisco, CA)\n", + " 16844188730126929499\n", + " male\n", + " 3 (Tract 3451.12, Contra Costa, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 37.0\n", - " 1929327997623174538\n", - " 1 (Tract 615.01, San Francisco, CA)\n", - " retail\n", + " 45.0\n", + " 702042337619124761\n", + " 3 (Tract 3451.12, Contra Costa, CA)\n", + " single_family\n", " in_person\n", " California\n", - " San Francisco\n", - " 1 (Tract 615.01, San Francisco, CA)\n", - " 615.01 (San Francisco, CA)\n", - " 198942.0\n", - " 2 (Tract 4507.51, Alameda, CA)\n", + " Contra Costa\n", + " 1 (Tract 168.01, San Francisco, CA)\n", + " 3451.12 (Contra Costa, CA)\n", + " 59948.0\n", + " 2 (Tract 168.01, San Francisco, CA)\n", " public_transit\n", " two\n", " auto_passenger\n", - " home\n", + " maintenance\n", " single_family\n", " NaN\n", " California\n", - " 4.0\n", - " Alameda\n", - " retail\n", - " naics5151\n", + " 2.0\n", + " San Francisco\n", + " single_family\n", + " naics621399\n", " owner\n", " unknown_fuel_type\n", - " 4507.51 (Alameda, CA)\n", - " 615.01 (San Francisco, CA)\n", - " advanced_degree\n", - " 08:50:00\n", - " 34978.0\n", + " 3451.12 (Contra Costa, CA)\n", + " 168.01 (San Francisco, CA)\n", + " bachelors_degree\n", + " 14:55:00\n", + " 59948.0\n", " employed\n", - " work\n", - " single_family\n", + " home\n", + " industrial\n", " San Francisco\n", - " 37.6\n", + " 39.5\n", " not_attending_school\n", - " Alameda\n", - " 11256368651162751791\n", - " 09:38:25\n", + " Contra Costa\n", + " 18202585350559013908\n", + " 16:08:28\n", " \n", " \n", "\n", "" ], "text/plain": [ - " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "267500 multi_family 53 english \n", - "318811 education 51 GQ_language \n", - "127266 multi_family 183 english \n", - "309112 retail 28 spanish \n", - "199784 single_family 48 indo_european \n", + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "341883 unknown 37 NaN \n", + "447416 retail 42 indo_european \n", + "220591 civic_institutional 51 indo_european \n", + "258399 retail 52 english \n", + "561394 industrial 73 english \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "267500 302.01 (San Francisco, CA) 2981999124390393386 male \n", - "318811 179.03 (San Francisco, CA) 294769040967747866 male \n", - "127266 102.01 (San Francisco, CA) 2007494479315805918 female \n", - "309112 6022.02 (San Mateo, CA) 12449373272305106079 male \n", - "199784 4507.51 (Alameda, CA) 14382520070638101596 female \n", + "341883 2512 (Solano, CA) NaN \n", + "447416 117 (San Francisco, CA) 3356014983482410625 male \n", + "220591 4033.02 (Alameda, CA) 5359921280509092684 male \n", + "258399 3080.02 (Contra Costa, CA) 3127751141200174941 female \n", + "561394 168.01 (San Francisco, CA) 16844188730126929499 male \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "267500 3 (Tract 302.01, San Francisco, CA) California \n", - "318811 1 (Tract 179.03, San Francisco, CA) California \n", - "127266 2 (Tract 102.01, San Francisco, CA) California \n", - "309112 2 (Tract 3810, Contra Costa, CA) California \n", - "199784 2 (Tract 4507.51, Alameda, CA) California \n", - "\n", - " trip_taker_home_st_2020 trip_taker_race_ethnicity \\\n", - "267500 California two_races_not_hispanic_or_latino \n", - "318811 California hispanic_or_latino_origin \n", - "127266 California hispanic_or_latino_origin \n", - "309112 California hispanic_or_latino_origin \n", - "199784 California asian_not_hispanic_or_latino \n", - "\n", - " transit_agency transit_route trip_taker_resident_type \\\n", - "267500 NaN NaN core \n", - "318811 NaN NaN core \n", - "127266 NaN NaN core \n", - "309112 NaN NaN core \n", - "199784 NaN NaN core \n", - "\n", - " vehicle_type trip_taker_age activity_id \\\n", - "267500 unknown_vehicle_type 27.0 16597255654725327963 \n", - "318811 unknown_vehicle_type 19.0 7487019993558144384 \n", - "127266 unknown_vehicle_type 28.0 14874947884140784827 \n", - "309112 unknown_vehicle_type 26.0 12179224938804524534 \n", - "199784 unknown_vehicle_type 37.0 1929327997623174538 \n", + "341883 NaN California \n", + "447416 4 (Tract 3373, Contra Costa, CA) California \n", + "220591 2 (Tract 3451.13, Contra Costa, CA) California \n", + "258399 1 (Tract 254.01, San Francisco, CA) California \n", + "561394 3 (Tract 3451.12, Contra Costa, CA) California \n", "\n", - " destination_bgrp_2020 destination_building_use \\\n", - "267500 1 (Tract 4222, Alameda, CA) single_family \n", - "318811 2 (Tract 3131.04, Contra Costa, CA) office \n", - "127266 2 (Tract 12.09, Nevada, CA) retail \n", - "309112 2 (Tract 3810, Contra Costa, CA) multi_family \n", - "199784 1 (Tract 615.01, San Francisco, CA) retail \n", - "\n", - " trip_taker_wfh destination_st_2020 \\\n", - "267500 employed_not_working California \n", - "318811 unemployed_under_16_not_in_labor_force California \n", - "127266 employed_not_working California \n", - "309112 unemployed_under_16_not_in_labor_force California \n", - "199784 in_person California \n", - "\n", - " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", - "267500 Alameda 3 (Tract 302.01, San Francisco, CA) \n", - "318811 Contra Costa Does not have work/school location \n", - "127266 Nevada 1 (Tract 2014.01, Napa, CA) \n", - "309112 Contra Costa Does not have work/school location \n", - "199784 San Francisco 1 (Tract 615.01, San Francisco, CA) \n", - "\n", - " destination_trct_2020 trip_taker_household_income \\\n", - "267500 4222 (Alameda, CA) 284387.0 \n", - "318811 3131.04 (Contra Costa, CA) 0.0 \n", - "127266 12.09 (Nevada, CA) 327465.0 \n", - "309112 3810 (Contra Costa, CA) 0.0 \n", - "199784 615.01 (San Francisco, CA) 198942.0 \n", - "\n", - " origin_bgrp_2020 trip_taker_commute_mode \\\n", - "267500 3 (Tract 302.01, San Francisco, CA) worked_from_home \n", - "318811 1 (Tract 179.03, San Francisco, CA) other_travel_mode \n", - "127266 2 (Tract 102.01, San Francisco, CA) private_auto \n", - "309112 1 (Tract 6022.02, San Mateo, CA) other_travel_mode \n", - "199784 2 (Tract 4507.51, Alameda, CA) public_transit \n", - "\n", - " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", - "267500 three_plus auto_passenger home \n", - "318811 unknown_num_vehicles private_auto home \n", - "127266 three_plus auto_passenger home \n", - "309112 three_plus auto_passenger work \n", - "199784 two auto_passenger home \n", - "\n", - " trip_taker_building_type transit_submode \\\n", - "267500 single_family NaN \n", - "318811 GQ_structure NaN \n", - "127266 multiple_units NaN \n", - "309112 several_units NaN \n", - "199784 single_family NaN \n", - "\n", - " trip_taker_work_st_2020 trip_taker_household_size \\\n", - "267500 California 3.0 \n", - "318811 Does not have work/school location 1.0 \n", - "127266 California 3.0 \n", - "309112 Does not have work/school location 2.0 \n", - "199784 California 4.0 \n", - "\n", - " origin_cty_2020 destination_land_use trip_taker_industry \\\n", - "267500 San Francisco single_family not_working \n", - "318811 San Francisco office not_working \n", - "127266 San Francisco retail naics3399 \n", - "309112 San Mateo multi_family not_working \n", - "199784 Alameda retail naics5151 \n", - "\n", - " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "267500 renter unknown_fuel_type 302.01 (San Francisco, CA) \n", - "318811 GQ other_non_bev 179.03 (San Francisco, CA) \n", - "127266 renter unknown_fuel_type 102.01 (San Francisco, CA) \n", - "309112 renter unknown_fuel_type 3810 (Contra Costa, CA) \n", - "199784 owner unknown_fuel_type 4507.51 (Alameda, CA) \n", - "\n", - " trip_taker_work_trct_2020 trip_taker_education \\\n", - "267500 302.01 (San Francisco, CA) bachelors_degree \n", - "318811 Does not have work/school location high_school \n", - "127266 2014.01 (Napa, CA) bachelors_degree \n", - "309112 Does not have work/school location some_college \n", - "199784 615.01 (San Francisco, CA) advanced_degree \n", - "\n", - " trip_start_time trip_taker_individual_income \\\n", - "267500 08:04:00 94781.0 \n", - "318811 14:07:00 0.0 \n", - "127266 09:02:00 111762.0 \n", - "309112 10:27:00 0.0 \n", - "199784 08:50:00 34978.0 \n", - "\n", - " trip_taker_employment_status trip_purpose origin_land_use \\\n", - "267500 employed school multi_family \n", - "318811 not_in_labor_force maintenance education \n", - "127266 employed shop multi_family \n", - "309112 not_in_labor_force home retail \n", - "199784 employed work single_family \n", - "\n", - " trip_taker_work_cty_2020 trip_distance_miles \\\n", - "267500 San Francisco 21.4 \n", - "318811 Does not have work/school location 35.2 \n", - "127266 Napa 185.6 \n", - "309112 Does not have work/school location 24.2 \n", - "199784 San Francisco 37.6 \n", - "\n", - " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", - "267500 not_attending_school San Francisco \n", - "318811 not_attending_school San Francisco \n", - "127266 not_attending_school San Francisco \n", - "309112 not_attending_school Contra Costa \n", - "199784 not_attending_school Alameda \n", - "\n", - " trip_taker_person_id trip_end_time \n", - "267500 114523536752271314 08:57:16 \n", - "318811 6449342572168120247 14:58:48 \n", - "127266 15665869551117189445 12:05:47 \n", - "309112 2304317130050975816 10:55:45 \n", - "199784 11256368651162751791 09:38:25 " + " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", + "341883 NaN NaN NaN \n", + "447416 California asian_not_hispanic_or_latino NaN \n", + "220591 California white_not_hispanic_or_latino NaN \n", + "258399 California white_not_hispanic_or_latino NaN \n", + "561394 California white_not_hispanic_or_latino NaN \n", + "\n", + " transit_route trip_taker_resident_type vehicle_type \\\n", + "341883 NaN NaN medium_commercial \n", + "447416 NaN core unknown_vehicle_type \n", + "220591 NaN core unknown_vehicle_type \n", + "258399 NaN core unknown_vehicle_type \n", + "561394 NaN core unknown_vehicle_type \n", + "\n", + " trip_taker_age activity_id \\\n", + "341883 NaN 8804416068045243289 \n", + "447416 70.0 18257242654773494745 \n", + "220591 36.0 6356762796714467304 \n", + "258399 42.0 7746586353797969666 \n", + "561394 45.0 702042337619124761 \n", + "\n", + " destination_bgrp_2020 destination_building_use \\\n", + "341883 1 (Tract 9809, San Francisco, CA) unknown \n", + "447416 4 (Tract 3373, Contra Costa, CA) single_family \n", + "220591 1 (Tract 9843, San Mateo, CA) transportation_utilities \n", + "258399 2 (Tract 6023, San Mateo, CA) retail \n", + "561394 3 (Tract 3451.12, Contra Costa, CA) single_family \n", + "\n", + " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", + "341883 NaN California San Francisco \n", + "447416 in_person California Contra Costa \n", + "220591 in_person California San Mateo \n", + "258399 remote California San Mateo \n", + "561394 in_person California Contra Costa \n", + "\n", + " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", + "341883 NaN 9809 (San Francisco, CA) \n", + "447416 3 (Tract 117, San Francisco, CA) 3373 (Contra Costa, CA) \n", + "220591 2 (Tract 4033.02, Alameda, CA) 9843 (San Mateo, CA) \n", + "258399 3 (Tract 254.01, San Francisco, CA) 6023 (San Mateo, CA) \n", + "561394 1 (Tract 168.01, San Francisco, CA) 3451.12 (Contra Costa, CA) \n", + "\n", + " trip_taker_household_income origin_bgrp_2020 \\\n", + "341883 NaN 3 (Tract 2512, Solano, CA) \n", + "447416 284542.0 3 (Tract 117, San Francisco, CA) \n", + "220591 143541.0 2 (Tract 4033.02, Alameda, CA) \n", + "258399 315157.0 2 (Tract 3080.02, Contra Costa, CA) \n", + "561394 59948.0 2 (Tract 168.01, San Francisco, CA) \n", + "\n", + " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", + "341883 NaN NaN commercial \n", + "447416 private_auto two private_auto \n", + "220591 public_transit two auto_passenger \n", + "258399 worked_from_home two auto_passenger \n", + "561394 public_transit two auto_passenger \n", + "\n", + " previous_trip_purpose trip_taker_building_type transit_submode \\\n", + "341883 commercial NaN NaN \n", + "447416 work single_family NaN \n", + "220591 work single_family NaN \n", + "258399 eat several_units NaN \n", + "561394 maintenance single_family NaN \n", + "\n", + " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", + "341883 NaN NaN Solano \n", + "447416 California 2.0 San Francisco \n", + "220591 California 5.0 Alameda \n", + "258399 California 4.0 Contra Costa \n", + "561394 California 2.0 San Francisco \n", + "\n", + " destination_land_use trip_taker_industry trip_taker_tenure \\\n", + "341883 unknown NaN NaN \n", + "447416 single_family naics4238 owner \n", + "220591 mixed_use naics92 owner \n", + "258399 retail naics42 renter \n", + "561394 single_family naics621399 owner \n", + "\n", + " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "341883 unknown_fuel_type NaN \n", + "447416 other_non_bev 3373 (Contra Costa, CA) \n", + "220591 unknown_fuel_type 3451.13 (Contra Costa, CA) \n", + "258399 unknown_fuel_type 254.01 (San Francisco, CA) \n", + "561394 unknown_fuel_type 3451.12 (Contra Costa, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", + "341883 NaN NaN 11:53:12 \n", + "447416 117 (San Francisco, CA) some_college 13:48:00 \n", + "220591 4033.02 (Alameda, CA) some_college 10:45:00 \n", + "258399 254.01 (San Francisco, CA) advanced_degree 20:25:00 \n", + "561394 168.01 (San Francisco, CA) bachelors_degree 14:55:00 \n", + "\n", + " trip_taker_individual_income trip_taker_employment_status \\\n", + "341883 NaN NaN \n", + "447416 150299.0 employed \n", + "220591 108472.0 employed \n", + "258399 135950.0 employed \n", + "561394 59948.0 employed \n", + "\n", + " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", + "341883 commercial unknown NaN \n", + "447416 home mixed_use San Francisco \n", + "220591 other_activity_type civic_institutional Alameda \n", + "258399 shop retail San Francisco \n", + "561394 home industrial San Francisco \n", + "\n", + " trip_distance_miles trip_taker_school_grade_attending \\\n", + "341883 32.7 NaN \n", + "447416 28.0 not_attending_school \n", + "220591 24.0 not_attending_school \n", + "258399 53.1 not_attending_school \n", + "561394 39.5 not_attending_school \n", + "\n", + " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", + "341883 NaN 12:31:00 \n", + "447416 Contra Costa 15153874493862167257 14:30:04 \n", + "220591 Contra Costa 6603722051605389622 11:36:05 \n", + "258399 San Francisco 11739595174551995701 21:17:29 \n", + "561394 Contra Costa 18202585350559013908 16:08:28 " ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -610,7 +614,7 @@ }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 8, "id": "1f3e4cbb-d211-40b1-b4bb-2c7cb43b33a9", "metadata": {}, "outputs": [ @@ -641,7 +645,7 @@ " dtype='object')" ] }, - "execution_count": 148, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -665,7 +669,7 @@ "tags": [] }, "source": [ - "#### Data Exploration: Replica\n", + "#### Data Exploration: Replica Trips\n", "* Summarizing the data that we exported from Replica\n", "* Existing visualizations in replica: \n", " * Primary Mode\n", @@ -686,7 +690,7 @@ }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 9, "id": "d7f3b44a-cd77-42e9-b0d8-7b9d228b37d5", "metadata": {}, "outputs": [], @@ -697,7 +701,7 @@ }, { "cell_type": "code", - "execution_count": 140, + "execution_count": 10, "id": "05893215-e993-44dc-9c4b-1aa7d94815cd", "metadata": {}, "outputs": [ @@ -706,23 +710,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trip_by_res_type)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"number_trips\"),\n", + " color=alt.Color(\"trip_taker_resident_type\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", + " )\n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f7b51fbb-8b87-4863-bcd9-50ed5047d7d6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -1598,7 +1829,7 @@ "[262323 rows x 2 columns]" ] }, - "execution_count": 8, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -1609,10 +1840,17 @@ }, { "cell_type": "code", - "execution_count": 79, - "id": "34f3079c-34b8-41e6-be02-ade8f229926a", + "execution_count": 57, + "id": "6fc3be54-b8dc-4cf8-893e-565ffa02934d", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "28\n" + ] + }, { "data": { "text/html": [ @@ -1690,2225 +1928,871 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + "
trip_taker_household_idn
24868627897
115980single_family8257752open_space13indo_european179.03 (San Francisco, CA)8194219563640751815malefemale1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originwhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type28.0116497427602101522902 (Tract 180, San Francisco, CA)industrialin_person34.0142400362149783507001 (Tract 125.03, San Francisco, CA)retailremoteCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)180 (San Francisco, CA)2 (Tract 231.03, San Francisco, CA)125.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)private_autoworked_from_homethree_plusauto_passengerhomerecreationsingle_familyNaNCalifornia10.0San Franciscoindustrialmixed_usenaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)180 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree07:26:00136907.007:53:00141119.0employedworksingle_familyeatmixed_useSan Francisco4.34.7not_attending_schoolSan Francisco1006625502873496796207:34:11474683141297534907008:06:39
116099industrial8indo_european180 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.035279292296024459791 (Tract 179.03, San Francisco, CA)single_familyin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 180, San Francisco, CA)private_autothree_plusauto_passengerworksingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree10:34:00136907.0employedhomeindustrialSan Francisco4.4not_attending_schoolSan Francisco1006625502873496796210:42:11
\n", + "
" + ], + "text/plain": [ + " origin_building_use trip_duration_minutes trip_taker_language \\\n", + "257752 open_space 13 indo_european \n", + "\n", + " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", + "257752 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "\n", + " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", + "257752 1 (Tract 179.03, San Francisco, CA) California \n", + "\n", + " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", + "257752 California white_not_hispanic_or_latino NaN \n", + "\n", + " transit_route trip_taker_resident_type vehicle_type \\\n", + "257752 NaN core unknown_vehicle_type \n", + "\n", + " trip_taker_age activity_id \\\n", + "257752 34.0 14240036214978350700 \n", + "\n", + " destination_bgrp_2020 destination_building_use \\\n", + "257752 1 (Tract 125.03, San Francisco, CA) retail \n", + "\n", + " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", + "257752 remote California San Francisco \n", + "\n", + " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", + "257752 2 (Tract 231.03, San Francisco, CA) 125.03 (San Francisco, CA) \n", + "\n", + " trip_taker_household_income origin_bgrp_2020 \\\n", + "257752 1200990.0 1 (Tract 179.03, San Francisco, CA) \n", + "\n", + " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", + "257752 worked_from_home three_plus auto_passenger \n", + "\n", + " previous_trip_purpose trip_taker_building_type transit_submode \\\n", + "257752 recreation single_family NaN \n", + "\n", + " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", + "257752 California 10.0 San Francisco \n", + "\n", + " destination_land_use trip_taker_industry trip_taker_tenure \\\n", + "257752 mixed_use naics31_33 renter \n", + "\n", + " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "257752 unknown_fuel_type 179.03 (San Francisco, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", + "257752 231.03 (San Francisco, CA) bachelors_degree 07:53:00 \n", + "\n", + " trip_taker_individual_income trip_taker_employment_status \\\n", + "257752 141119.0 employed \n", + "\n", + " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", + "257752 eat mixed_use San Francisco \n", + "\n", + " trip_distance_miles trip_taker_school_grade_attending \\\n", + "257752 4.7 not_attending_school \n", + "\n", + " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", + "257752 San Francisco 4746831412975349070 08:06:39 " + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## checking one household id\n", + "print(len(r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)))\n", + "(r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)).sample()" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "4eccfdf8-429e-43df-899e-f7d77e051831", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + "
trip_taker_person_idtrip_taker_agetrip_taker_sextrip_taker_household_sizen
257674retail20indo_european4028.01 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type0132518174655286855422.0176072582217114658141 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 4028.01, Alameda, CA)worked_from_homethree_plusprivate_autoshopsingle_familyNaNCaliforniafemale10.0Alamedasingle_familynaics62renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree17:23:0076878.0employedhomeretailSan Francisco8.3not_attending_schoolSan Francisco132518174655286855417:43:256
257680retail1231033106690090267930.0female10.06indo_european615.06 (San Francisco, CA)8194219563640751815
2474683141297534907034.0female10.02
31006625502873496796228.0male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.042581078924317635031 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree23:59:00218735.0employedhomemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981100:05:274
257681retail18indo_european4024 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0126733592554790094421 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 4024, Alameda, CA)worked_from_homethree_plusauto_passengereatsingle_familyNaNCalifornia41105847776148723085432.0male10.0Alamedasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree20:21:0058975.0employedhomeretailSan Francisco8.4not_attending_schoolSan Francisco231033106690090267920:39:522
257700single_family20indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.0117962098623958508221 (Tract 4028.01, Alameda, CA)retailremoteCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree18:16:0076878.0employedshopsingle_familySan Francisco8.8not_attending_schoolSan Francisco132518174655286855418:36:37
257740retail18indo_european4028.01 (Alameda, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.029071925784277998261 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 4028.01, Alameda, CA)worked_from_homethree_plusprivate_autoshopsingle_familyNaNCalifornia10.0Alamedasingle_familynaics62renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree20:25:0076878.0employedhomeretailSan Francisco8.3not_attending_schoolSan Francisco132518174655286855420:43:21
257742retail25indo_european131.01 (San Francisco, CA)819421956364075181551289494630026574219339.0male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type32.051918639015747599111 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.04 (Tract 131.01, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree13:52:00184297.0employedwork_from_homemixed_useSan Francisco7.7not_attending_schoolSan Francisco1105847776148723085414:17:22
257752open_space13indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type34.0142400362149783507001 (Tract 125.03, San Francisco, CA)retailremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)125.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerrecreationsingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree07:53:00141119.0employedeatmixed_useSan Francisco4.7not_attending_schoolSan Francisco474683141297534907008:06:39
257766single_family25indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.021376383045737346732 (Tract 3690.01, Contra Costa, CA)officeemployed_not_workingCaliforniaContra Costa1 (Tract 179.03, San Francisco, CA)3690.01 (Contra Costa, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoofficenaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree09:07:0058975.0employedshopsingle_familySan Francisco15.3not_attending_schoolSan Francisco231033106690090267909:32:342
257782single_family21indo_european179.03 (San Francisco, CA)819421956364075181561440969234057495981127.0male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type32.0105450082426352247834 (Tract 131.01, San Francisco, CA)retailremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)131.01 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree13:18:00184297.0employedshopsingle_familySan Francisco7.6not_attending_schoolSan Francisco1105847776148723085413:39:06
319406retail6indo_european615.07 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type39.094317011050365135501 (Tract 179.03, San Francisco, CA)single_familyunemployed_under_16_not_in_labor_forceCaliforniaSan FranciscoDoes not have work/school location179.03 (San Francisco, CA)1200990.01 (Tract 615.07, San Francisco, CA)other_travel_modethree_plusauto_passengereatsingle_familyNaNDoes not have work/school location10.0San Franciscosingle_familynaics72renterunknown_fuel_type179.03 (San Francisco, CA)Does not have work/school locationhigh_school22:00:0078984.0unemployedhomemixed_useDoes not have work/school location3.7not_attending_schoolSan Francisco1289494630026574219322:06:39
453990single_family31indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.021835416939884039682 (Tract 231.03, San Francisco, CA)industrialin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)231.03 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)private_autothree_plusprivate_autohomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics31_33renterother_non_bev179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree12:44:00136907.0employedmaintenancesingle_familySan Francisco9.6not_attending_schoolSan Francisco1006625502873496796213:15:05
454315single_family30indo_european6019.01 (San Mateo, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniahispanic_or_latino_originNaNNaNcoreunknown_vehicle_type28.024323779474769505221 (Tract 179.03, San Francisco, CA)single_familyin_personCaliforniaSan Francisco2 (Tract 180, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 6019.01, San Mateo, CA)private_autothree_plusprivate_autosocialsingle_familyNaNCalifornia10.0San Mateosingle_familynaics31_33renterother_non_bev179.03 (San Francisco, CA)180 (San Francisco, CA)bachelors_degree19:53:00136907.0employedhomesingle_familySan Francisco15.0not_attending_schoolSan Francisco1006625502873496796220:23:26
594828single_family10indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0158851067883991515563 (Tract 615.06, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)615.06 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusprivate_autowork_from_homesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics54renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree22:30:00218735.0employedshopsingle_familySan Francisco4.0not_attending_schoolSan Francisco1440969234057495981122:40:27
594837single_family27indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.08124378838850198162 (Tract 3690.01, Contra Costa, CA)officeemployed_not_workingCaliforniaContra Costa1 (Tract 179.03, San Francisco, CA)3690.01 (Contra Costa, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoofficenaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:15:0058975.0employedshopsingle_familySan Francisco15.3not_attending_schoolSan Francisco231033106690090267915:42:31
594840retail7indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.0128416754049579796411 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree12:50:00218735.0employedwork_from_homemixed_useSan Francisco3.7not_attending_schoolSan Francisco1440969234057495981112:57:01
594856single_family11indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type27.078783471048378956383 (Tract 615.06, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)615.06 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusprivate_autohomesingle_familyNaNCalifornia10.0San Franciscomixed_usenaics54renterother_non_bev179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:44:00218735.0employedshopsingle_familySan Francisco4.0not_attending_schoolSan Francisco1440969234057495981111:55:07
594859single_family19indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0170742202348262979312 (Tract 4024, Alameda, CA)retailemployed_not_workingCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4024 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree19:08:0058975.0employedeatsingle_familySan Francisco8.5not_attending_schoolSan Francisco231033106690090267919:27:48
594862single_family14indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type22.070171872167603447431 (Tract 4028.01, Alameda, CA)retailremoteCaliforniaAlameda1 (Tract 179.03, San Francisco, CA)4028.01 (Alameda, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerwork_from_homesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree16:09:0076878.0employedshopsingle_familySan Francisco7.6not_attending_schoolSan Francisco132518174655286855416:23:22
594873office25indo_european3690.01 (Contra Costa, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0158848542161360155521 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0Contra Costasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree15:50:3158975.0employedhomeofficeSan Francisco14.9not_attending_schoolSan Francisco231033106690090267916:16:28
594877retail13indo_european125.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type34.027828652091505974131 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco2 (Tract 231.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.01 (Tract 125.03, San Francisco, CA)worked_from_homethree_plusauto_passengereatsingle_familyNaNCalifornia10.0San Franciscosingle_familynaics31_33renterunknown_fuel_type179.03 (San Francisco, CA)231.03 (San Francisco, CA)bachelors_degree09:55:00141119.0employedwork_from_homemixed_useSan Francisco4.9not_attending_schoolSan Francisco474683141297534907010:08:11
\n", + "
" + ], + "text/plain": [ + " trip_taker_person_id trip_taker_age trip_taker_sex \\\n", + "0 1325181746552868554 22.0 female \n", + "1 2310331066900902679 30.0 female \n", + "2 4746831412975349070 34.0 female \n", + "3 10066255028734967962 28.0 male \n", + "4 11058477761487230854 32.0 male \n", + "5 12894946300265742193 39.0 male \n", + "6 14409692340574959811 27.0 male \n", + "\n", + " trip_taker_household_size n \n", + "0 10.0 6 \n", + "1 10.0 6 \n", + "2 10.0 2 \n", + "3 10.0 4 \n", + "4 10.0 2 \n", + "5 10.0 2 \n", + "6 10.0 6 " + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## checking one household id\n", + "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)>>count(_.trip_taker_person_id, _.trip_taker_age,\n", + " _.trip_taker_sex, _.trip_taker_household_size)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c929c77d-0173-4a7d-be49-762349daf5cb", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ab226b47-4366-4fb9-aaae-e0aca760f9b3", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "cd041141-2a65-45e8-a6ba-9b41cbffecbd", + "metadata": {}, + "source": [ + "#### Adding in Replica's People Dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "id": "dea31a60-e986-41e7-b31b-1e5403c9e041", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_265/1951040339.py:1: DtypeWarning: Columns (25) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " r_ppl = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_ppl}\"))\n" + ] + } + ], + "source": [ + "r_ppl = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_ppl}\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "id": "42bc1220-b404-4aca-8214-43992c55163b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
person_idwork_st_2020household_incomeresident_typelanguageavailable_vehiclesrace_ethnicityeducationwork_bgrp_2020wfhhome_cty_2020home_trct_2020tenureindustrywork_trct_2020school_grade_attendingbuilding_typecommute_modeemployment_statuswork_cty_2020individual_incomehome_st_2020sexhousehold_sizehome_bgrp_2020household_idage
594894single_family9indo_european179.03 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latino2937782172319439732228215Visitor (no work/school location)NaNvisitorNaNcoreunknown_vehicle_type22.046418471271854126672 (Tract 176.02, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)176.02 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyNaNCalifornia10.0San Franciscoretailnaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree13:50:0076878.0employedshopsingle_familySan Francisco4.8not_attending_schoolSan Francisco132518174655286855413:59:55
594901office23indo_european3690.01 (Contra Costa, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaNcoreunknown_vehicle_type30.0154662223374951985911 (Tract 179.03, San Francisco, CA)single_familyemployed_not_workingCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 3690.01, Contra Costa, CA)worked_from_homethree_plusauto_passengershopsingle_familyVisitor (no work/school location)NaNCalifornia10.0Contra Costasingle_familynaics61renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree13:10:0058975.0employedhomeofficeSan Francisco14.9not_attending_schoolSan Francisco231033106690090267913:33:44
594935single_family14indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniawhite_not_hispanic_or_latinoVisitor (no home location)Visitor (no home location)NaNNaNcoreunknown_vehicle_type27.0135315509748273377653 (Tract 117, San Francisco, CA)retailremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)117 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)worked_from_homethree_plusauto_passengerhomesingle_familyVisitor (no work/school location)NaNCalifornia10.0San Franciscoretailnaics54renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree09:18:00218735.0employedshopsingle_familySan Francisco5.0not_attending_schoolSan Francisco1440969234057495981109:32:26
594962retail16indo_european176.02 (San Francisco, CA)8194219563640751815female1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaNNaNVisitor (no work/school location)NaNVisitor (no home location)NaNNaNVisitor (no home location)NaN
1870861232617019565993485Does not have work/school location357385.0coreunknown_vehicle_type22.019671048820994471501 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.02 (Tract 176.02, San Francisco, CA)worked_from_homeasian_pacificthree_plusauto_passengershopasian_not_hispanic_or_latinono_schoolDoes not have work/school locationunemployed_under_16_not_in_labor_forceSan Mateo6004.02 (San Mateo, CA)ownernot_workingDoes not have work/school locationnot_attending_schoolsingle_familyNaNother_travel_modenot_in_labor_forceDoes not have work/school location0.0California10.0San Franciscosingle_familynaics62renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree14:31:0076878.0employedwork_from_homeretailSan Francisco4.8not_attending_schoolSan Francisco132518174655286855414:47:49male5.01 (Tract 6004.02, San Mateo, CA)1276956995572922957970.0
594972retail6indo_european615.06 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)20581811389470679660779632CaliforniaCaliforniawhite_not_hispanic_or_latinoNaNNaN20598.0coreunknown_vehicle_type27.013973907958114505021 (Tract 179.03, San Francisco, CA)single_familyremoteCaliforniaSan Francisco1 (Tract 179.03, San Francisco, CA)179.03 (San Francisco, CA)1200990.03 (Tract 615.06, San Francisco, CA)worked_from_homethree_plusauto_passengershopsingle_familyNaNCalifornia10.0englishonewhite_not_hispanic_or_latinoadvanced_degree1 (Tract 5064.01, Santa Clara, CA)in_personSan Franciscosingle_familynaics54125.03 (San Francisco, CA)renterunknown_fuel_type179.03 (San Francisco, CA)179.03 (San Francisco, CA)bachelors_degree11:24:00218735.0employedhomemixed_useSan Francisco3.7naics565064.01 (Santa Clara, CA)not_attending_schoolSan Francisco1440969234057495981111:30:46multiple_unitsprivate_autoemployedSanta Clara20598.0Californiamale1.01 (Tract 125.03, San Francisco, CA)641240191809008879062.0
656110single_family9indo_european179.03 (San Francisco, CA)8194219563640751815male1 (Tract 179.03, San Francisco, CA)CaliforniaCaliforniaasian_not_hispanic_or_latinoNaNNaN2486816082366692397729873Does not have work/school location16724.0coreunknown_vehicle_type39.0135410986435712566981 (Tract 615.07, San Francisco, CA)retailspanishonehispanic_or_latino_originbachelors_degreeDoes not have work/school locationunemployed_under_16_not_in_labor_forceCaliforniaSan FranciscoAlameda4040 (Alameda, CA)renternot_workingDoes not have work/school location615.07 (San Francisco, CA)1200990.01 (Tract 179.03, San Francisco, CA)not_attending_schoolmultiple_unitsother_travel_modethree_plusprivate_autohomesingle_familyNaNnot_in_labor_forceDoes not have work/school location10.0San Franciscomixed_usenaics7216724.0Californiafemale1.02 (Tract 4040, Alameda, CA)24524536593985522076.0
156693127754813479201959California205985.0coreenglishtwowhite_not_hispanic_or_latinoadvanced_degree2 (Tract 134.01, San Francisco, CA)in_personAlameda4009 (Alameda, CA)renterother_non_bev179.03 (San Francisco, CA)Does not have work/school locationhigh_school18:10:0078984.0unemployedeatsingle_familyDoes not have work/school location3.9not_working134.01 (San Francisco, CA)not_attending_schoolsingle_familyprivate_autoemployedSan Francisco1289494630026574219318:19:12102992.0Californiamale3.01 (Tract 4009, Alameda, CA)1192937946230496672332.0
\n", "
" ], "text/plain": [ - " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "115980 single_family 8 indo_european \n", - "116099 industrial 8 indo_european \n", - "257674 retail 20 indo_european \n", - "257680 retail 6 indo_european \n", - "257681 retail 18 indo_european \n", - "257700 single_family 20 indo_european \n", - "257740 retail 18 indo_european \n", - "257742 retail 25 indo_european \n", - "257752 open_space 13 indo_european \n", - "257766 single_family 25 indo_european \n", - "257782 single_family 21 indo_european \n", - "319406 retail 6 indo_european \n", - "453990 single_family 31 indo_european \n", - "454315 single_family 30 indo_european \n", - "594828 single_family 10 indo_european \n", - "594837 single_family 27 indo_european \n", - "594840 retail 7 indo_european \n", - "594856 single_family 11 indo_european \n", - "594859 single_family 19 indo_european \n", - "594862 single_family 14 indo_european \n", - "594873 office 25 indo_european \n", - "594877 retail 13 indo_european \n", - "594894 single_family 9 indo_european \n", - "594901 office 23 indo_european \n", - "594935 single_family 14 indo_european \n", - "594962 retail 16 indo_european \n", - "594972 retail 6 indo_european \n", - "656110 single_family 9 indo_european \n", - "\n", - " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "115980 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "116099 180 (San Francisco, CA) 8194219563640751815 male \n", - "257674 4028.01 (Alameda, CA) 8194219563640751815 female \n", - "257680 615.06 (San Francisco, CA) 8194219563640751815 male \n", - "257681 4024 (Alameda, CA) 8194219563640751815 female \n", - "257700 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "257740 4028.01 (Alameda, CA) 8194219563640751815 female \n", - "257742 131.01 (San Francisco, CA) 8194219563640751815 male \n", - "257752 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "257766 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "257782 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "319406 615.07 (San Francisco, CA) 8194219563640751815 male \n", - "453990 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "454315 6019.01 (San Mateo, CA) 8194219563640751815 male \n", - "594828 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "594837 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "594840 615.06 (San Francisco, CA) 8194219563640751815 male \n", - "594856 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "594859 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "594862 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "594873 3690.01 (Contra Costa, CA) 8194219563640751815 female \n", - "594877 125.03 (San Francisco, CA) 8194219563640751815 female \n", - "594894 179.03 (San Francisco, CA) 8194219563640751815 female \n", - "594901 3690.01 (Contra Costa, CA) 8194219563640751815 female \n", - "594935 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "594962 176.02 (San Francisco, CA) 8194219563640751815 female \n", - "594972 615.06 (San Francisco, CA) 8194219563640751815 male \n", - "656110 179.03 (San Francisco, CA) 8194219563640751815 male \n", - "\n", - " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "115980 1 (Tract 179.03, San Francisco, CA) California \n", - "116099 1 (Tract 179.03, San Francisco, CA) California \n", - "257674 1 (Tract 179.03, San Francisco, CA) California \n", - "257680 1 (Tract 179.03, San Francisco, CA) California \n", - "257681 1 (Tract 179.03, San Francisco, CA) California \n", - "257700 1 (Tract 179.03, San Francisco, CA) California \n", - "257740 1 (Tract 179.03, San Francisco, CA) California \n", - "257742 1 (Tract 179.03, San Francisco, CA) California \n", - "257752 1 (Tract 179.03, San Francisco, CA) California \n", - "257766 1 (Tract 179.03, San Francisco, CA) California \n", - "257782 1 (Tract 179.03, San Francisco, CA) California \n", - "319406 1 (Tract 179.03, San Francisco, CA) California \n", - "453990 1 (Tract 179.03, San Francisco, CA) California \n", - "454315 1 (Tract 179.03, San Francisco, CA) California \n", - "594828 1 (Tract 179.03, San Francisco, CA) California \n", - "594837 1 (Tract 179.03, San Francisco, CA) California \n", - "594840 1 (Tract 179.03, San Francisco, CA) California \n", - "594856 1 (Tract 179.03, San Francisco, CA) California \n", - "594859 1 (Tract 179.03, San Francisco, CA) California \n", - "594862 1 (Tract 179.03, San Francisco, CA) California \n", - "594873 1 (Tract 179.03, San Francisco, CA) California \n", - "594877 1 (Tract 179.03, San Francisco, CA) California \n", - "594894 1 (Tract 179.03, San Francisco, CA) California \n", - "594901 1 (Tract 179.03, San Francisco, CA) California \n", - "594935 1 (Tract 179.03, San Francisco, CA) California \n", - "594962 1 (Tract 179.03, San Francisco, CA) California \n", - "594972 1 (Tract 179.03, San Francisco, CA) California \n", - "656110 1 (Tract 179.03, San Francisco, CA) California \n", + " person_id work_st_2020 \\\n", + "293778 2172319439732228215 Visitor (no work/school location) \n", + "187086 1232617019565993485 Does not have work/school location \n", + "205818 11389470679660779632 California \n", + "24868 16082366692397729873 Does not have work/school location \n", + "15669 3127754813479201959 California \n", + "\n", + " household_income resident_type language available_vehicles \\\n", + "293778 NaN visitor NaN NaN \n", + "187086 357385.0 core asian_pacific three_plus \n", + "205818 20598.0 core english one \n", + "24868 16724.0 core spanish one \n", + "15669 205985.0 core english two \n", + "\n", + " race_ethnicity education \\\n", + "293778 NaN NaN \n", + "187086 asian_not_hispanic_or_latino no_school \n", + "205818 white_not_hispanic_or_latino advanced_degree \n", + "24868 hispanic_or_latino_origin bachelors_degree \n", + "15669 white_not_hispanic_or_latino advanced_degree \n", + "\n", + " work_bgrp_2020 \\\n", + "293778 Visitor (no work/school location) \n", + "187086 Does not have work/school location \n", + "205818 1 (Tract 5064.01, Santa Clara, CA) \n", + "24868 Does not have work/school location \n", + "15669 2 (Tract 134.01, San Francisco, CA) \n", + "\n", + " wfh home_cty_2020 \\\n", + "293778 NaN Visitor (no home location) \n", + "187086 unemployed_under_16_not_in_labor_force San Mateo \n", + "205818 in_person San Francisco \n", + "24868 unemployed_under_16_not_in_labor_force Alameda \n", + "15669 in_person Alameda \n", + "\n", + " home_trct_2020 tenure industry \\\n", + "293778 Visitor (no home location) NaN NaN \n", + "187086 6004.02 (San Mateo, CA) owner not_working \n", + "205818 125.03 (San Francisco, CA) renter naics56 \n", + "24868 4040 (Alameda, CA) renter not_working \n", + "15669 4009 (Alameda, CA) renter not_working \n", + "\n", + " work_trct_2020 school_grade_attending \\\n", + "293778 Visitor (no work/school location) NaN \n", + "187086 Does not have work/school location not_attending_school \n", + "205818 5064.01 (Santa Clara, CA) not_attending_school \n", + "24868 Does not have work/school location not_attending_school \n", + "15669 134.01 (San Francisco, CA) not_attending_school \n", + "\n", + " building_type commute_mode employment_status \\\n", + "293778 NaN NaN NaN \n", + "187086 single_family other_travel_mode not_in_labor_force \n", + "205818 multiple_units private_auto employed \n", + "24868 multiple_units other_travel_mode not_in_labor_force \n", + "15669 single_family private_auto employed \n", + "\n", + " work_cty_2020 individual_income \\\n", + "293778 Visitor (no work/school location) NaN \n", + "187086 Does not have work/school location 0.0 \n", + "205818 Santa Clara 20598.0 \n", + "24868 Does not have work/school location 16724.0 \n", + "15669 San Francisco 102992.0 \n", + "\n", + " home_st_2020 sex household_size \\\n", + "293778 Visitor (no home location) NaN NaN \n", + "187086 California male 5.0 \n", + "205818 California male 1.0 \n", + "24868 California female 1.0 \n", + "15669 California male 3.0 \n", + "\n", + " home_bgrp_2020 household_id age \n", + "293778 Visitor (no home location) NaN \n", + "187086 1 (Tract 6004.02, San Mateo, CA) 12769569955729229579 70.0 \n", + "205818 1 (Tract 125.03, San Francisco, CA) 6412401918090088790 62.0 \n", + "24868 2 (Tract 4040, Alameda, CA) 245245365939855220 76.0 \n", + "15669 1 (Tract 4009, Alameda, CA) 11929379462304966723 32.0 " + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_ppl.sample(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "id": "570daf6d-06b8-46e5-9664-a71c5a093073", + "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", + "
resident_type_unique_ids
0core278158
1visitor23034
\n", + "
" + ], + "text/plain": [ + " resident_type _unique_ids\n", + "0 core 278158\n", + "1 visitor 23034" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_ppl>>group_by(_.resident_type)>>summarize(_unique_ids = _.person_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "2f4b67bf-78ab-4aa8-bbb0-e382a8f78c9a", + "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", + "
commute_modesexn_pplavg_h_incomeavg_p_incomeavg_age
0auto_passengerfemale10908175717.98276570255.62605442.234507
1auto_passengermale11605177241.39491682072.29168542.185523
2bikingfemale234248565.14102682592.41880336.085470
3bikingmale527219563.083491120152.85958338.426945
4other_travel_modefemale36176126129.72100321413.68293955.161599
5other_travel_modemale26290116775.54910633563.07881354.328262
6private_autofemale45312186499.65940676492.00534142.626302
7private_automale59762190643.201265100712.38691842.872093
8public_transitfemale22008193540.92134784074.07211041.921937
9public_transitmale26480207838.001699125445.94248542.259290
10walkingfemale1332160144.72597663737.95645638.041291
11walkingmale1494177570.705489100413.45515437.495315
12worked_from_homefemale17409226232.99965597016.43885341.219829
13worked_from_homemale18621253921.717631137849.97368641.092208
\n", + "
" + ], + "text/plain": [ + " commute_mode sex n_ppl avg_h_income avg_p_income avg_age\n", + "0 auto_passenger female 10908 175717.982765 70255.626054 42.234507\n", + "1 auto_passenger male 11605 177241.394916 82072.291685 42.185523\n", + "2 biking female 234 248565.141026 82592.418803 36.085470\n", + "3 biking male 527 219563.083491 120152.859583 38.426945\n", + "4 other_travel_mode female 36176 126129.721003 21413.682939 55.161599\n", + "5 other_travel_mode male 26290 116775.549106 33563.078813 54.328262\n", + "6 private_auto female 45312 186499.659406 76492.005341 42.626302\n", + "7 private_auto male 59762 190643.201265 100712.386918 42.872093\n", + "8 public_transit female 22008 193540.921347 84074.072110 41.921937\n", + "9 public_transit male 26480 207838.001699 125445.942485 42.259290\n", + "10 walking female 1332 160144.725976 63737.956456 38.041291\n", + "11 walking male 1494 177570.705489 100413.455154 37.495315\n", + "12 worked_from_home female 17409 226232.999655 97016.438853 41.219829\n", + "13 worked_from_home male 18621 253921.717631 137849.973686 41.092208" ] }, - "execution_count": 79, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "## checking one household id\n", - "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)" + "(r_ppl\n", + " >>filter(_.home_bgrp_2020!=\"Visitor (no home location)\")\n", + " >>group_by(_.commute_mode, _.sex)\n", + " >>summarize(\n", + " n_ppl = _.person_id.nunique(),\n", + " avg_h_income = _.household_income.mean(),\n", + " avg_p_income = _.individual_income.mean(),\n", + " avg_age = _.age.mean())\n", + ")" ] }, { "cell_type": "code", - "execution_count": 85, - "id": "4eccfdf8-429e-43df-899e-f7d77e051831", + "execution_count": 62, + "id": "2e4bd058-9c4d-4989-a5fc-db6cf6130bf2", "metadata": {}, "outputs": [ { @@ -3932,109 +2816,146 @@ " \n", " \n", " \n", - " trip_taker_person_id\n", - " trip_taker_age\n", + " primary_mode\n", " trip_taker_sex\n", - " trip_taker_household_size\n", - " n\n", + " n_ppl\n", + " avg_h_income\n", + " avg_p_income\n", + " avg_age\n", " \n", " \n", " \n", " \n", " 0\n", - " 1325181746552868554\n", - " 22.0\n", + " auto_passenger\n", " female\n", - " 10.0\n", - " 6\n", + " 99350\n", + " 173666.662228\n", + " 65104.398490\n", + " 45.064633\n", " \n", " \n", " 1\n", - " 2310331066900902679\n", - " 30.0\n", - " female\n", - " 10.0\n", - " 6\n", + " auto_passenger\n", + " male\n", + " 105359\n", + " 187590.985442\n", + " 97296.509379\n", + " 43.991868\n", " \n", " \n", " 2\n", - " 4746831412975349070\n", - " 34.0\n", - " female\n", - " 10.0\n", - " 2\n", + " commercial\n", + " NaN\n", + " 1\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", " 3\n", - " 10066255028734967962\n", - " 28.0\n", - " male\n", - " 10.0\n", - " 4\n", + " on_demand_auto\n", + " female\n", + " 9051\n", + " 186226.833189\n", + " 79990.395102\n", + " 42.900399\n", " \n", " \n", " 4\n", - " 11058477761487230854\n", - " 32.0\n", + " on_demand_auto\n", " male\n", - " 10.0\n", - " 2\n", + " 10159\n", + " 202467.780725\n", + " 111915.392968\n", + " 42.436605\n", " \n", " \n", " 5\n", - " 12894946300265742193\n", - " 39.0\n", - " male\n", - " 10.0\n", - " 2\n", + " private_auto\n", + " female\n", + " 68268\n", + " 174867.937251\n", + " 62299.064752\n", + " 45.316785\n", " \n", " \n", " 6\n", - " 14409692340574959811\n", - " 27.0\n", + " private_auto\n", " male\n", - " 10.0\n", - " 6\n", + " 75223\n", + " 182301.952228\n", + " 90322.373466\n", + " 44.265320\n", + " \n", + " \n", + " 7\n", + " public_transit\n", + " female\n", + " 2256\n", + " 186720.499643\n", + " 82496.554922\n", + " 39.104494\n", + " \n", + " \n", + " 8\n", + " public_transit\n", + " male\n", + " 2535\n", + " 205334.441232\n", + " 114041.914833\n", + " 38.312382\n", " \n", " \n", "\n", "" ], "text/plain": [ - " trip_taker_person_id trip_taker_age trip_taker_sex \\\n", - "0 1325181746552868554 22.0 female \n", - "1 2310331066900902679 30.0 female \n", - "2 4746831412975349070 34.0 female \n", - "3 10066255028734967962 28.0 male \n", - "4 11058477761487230854 32.0 male \n", - "5 12894946300265742193 39.0 male \n", - "6 14409692340574959811 27.0 male \n", - "\n", - " trip_taker_household_size n \n", - "0 10.0 6 \n", - "1 10.0 6 \n", - "2 10.0 2 \n", - "3 10.0 4 \n", - "4 10.0 2 \n", - "5 10.0 2 \n", - "6 10.0 6 " + " primary_mode trip_taker_sex n_ppl avg_h_income avg_p_income \\\n", + "0 auto_passenger female 99350 173666.662228 65104.398490 \n", + "1 auto_passenger male 105359 187590.985442 97296.509379 \n", + "2 commercial NaN 1 NaN NaN \n", + "3 on_demand_auto female 9051 186226.833189 79990.395102 \n", + "4 on_demand_auto male 10159 202467.780725 111915.392968 \n", + "5 private_auto female 68268 174867.937251 62299.064752 \n", + "6 private_auto male 75223 182301.952228 90322.373466 \n", + "7 public_transit female 2256 186720.499643 82496.554922 \n", + "8 public_transit male 2535 205334.441232 114041.914833 \n", + "\n", + " avg_age \n", + "0 45.064633 \n", + "1 43.991868 \n", + "2 NaN \n", + "3 42.900399 \n", + "4 42.436605 \n", + "5 45.316785 \n", + "6 44.265320 \n", + "7 39.104494 \n", + "8 38.312382 " ] }, - "execution_count": 85, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "## checking one household id\n", - "r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)>>count(_.trip_taker_person_id, _.trip_taker_age,\n", - " _.trip_taker_sex, _.trip_taker_household_size)" + "(r_trips\n", + " >>filter(_.trip_taker_home_bgrp_2020!=\"Visitor (no home location)\")\n", + " >>group_by(_.primary_mode, _.trip_taker_sex)\n", + " >>summarize(\n", + " n_ppl = _.trip_taker_person_id.nunique(),\n", + " avg_h_income = _.trip_taker_household_income.mean(),\n", + " avg_p_income = _.trip_taker_individual_income.mean(),\n", + " avg_age = _.trip_taker_age.mean())\n", + ")\n", + " " ] }, { "cell_type": "code", "execution_count": null, - "id": "c929c77d-0173-4a7d-be49-762349daf5cb", + "id": "7b637cdd-9560-4d31-bfeb-bffa6cbb55d2", "metadata": {}, "outputs": [], "source": [] @@ -4042,7 +2963,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad574f5a-8780-443e-8a16-52387d0a1fb8", + "id": "7f7c1066-c820-43d3-a68e-0dcdfc1dcdce", "metadata": {}, "outputs": [], "source": [] @@ -4065,7 +2986,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 63, "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", "metadata": {}, "outputs": [], @@ -4075,7 +2996,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 64, "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", "metadata": {}, "outputs": [], @@ -4085,7 +3006,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 65, "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", "metadata": {}, "outputs": [ @@ -4134,119 +3055,119 @@ " \n", " \n", " \n", - " 1249\n", + " 352\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1125811810\n", - " I 80 / 839972874 / 1\n", + " 1032819756\n", + " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", " Motorway\n", - " 0.111\n", + " 0.109\n", " yes\n", - " 85\n", - " EAST\n", + " 220\n", + " WEST\n", " no\n", " 2: Weekend Day (Sa-Su)\n", - " 19: 3pm (3pm-4pm)\n", - " 7876\n", - " 62\n", - " 7\n", - " 70.037\n", - " 875.09\n", - " 1.13\n", - " False\n", - " 70\n", + " 22: 5pm (5pm-6pm)\n", + " 6476\n", + " 29\n", + " 14\n", + " 68.596\n", + " 707.61\n", + " 2.37\n", + " True\n", + " 55\n", " \n", " \n", - " 1024\n", + " 434\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1118036302\n", - " I 80 / 839972875 / 1\n", + " 1036056766\n", + " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", " Motorway\n", - " 0.006\n", + " 0.073\n", " yes\n", - " 265\n", - " WEST\n", + " 37\n", + " EAST\n", " no\n", - " 1: Weekday (M-F)\n", - " 04: 2am (2am-3am)\n", - " 682\n", - " 67\n", - " 2\n", - " 68.762\n", - " 3.79\n", - " 1.02\n", - " False\n", - " 75\n", + " 2: Weekend Day (Sa-Su)\n", + " 14: Mid-Day (10am-4pm)\n", + " 54253\n", + " 52\n", + " 4\n", + " 67.267\n", + " 3947.53\n", + " 1.28\n", + " True\n", + " 64\n", " \n", " \n", - " 559\n", + " 831\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1093181568\n", - " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", + " 1114495634\n", + " I 80 / 395419317 / 1\n", " Motorway\n", - " 0.109\n", + " 0.213\n", " yes\n", - " 40\n", + " 82\n", " EAST\n", " no\n", " 0: All Days (M-Su)\n", - " 19: 3pm (3pm-4pm)\n", - " 9364\n", - " 40\n", - " 9\n", - " 66.047\n", - " 1020.38\n", - " 1.64\n", - " True\n", - " 56\n", + " 21: Peak PM (4pm-8pm)\n", + " 32982\n", + " 60\n", + " 13\n", + " 69.063\n", + " 7040.73\n", + " 1.15\n", + " False\n", + " 68\n", " \n", " \n", - " 722\n", + " 1301\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1112062603\n", - " San Francisco – Oakland Bay Bridge / 236348361...\n", + " 1128174334\n", + " San Francisco – Oakland Bay Bridge / 237731428...\n", " Motorway\n", - " 1.878\n", + " 0.177\n", " yes\n", - " 260\n", - " WEST\n", + " 43\n", + " EAST\n", " no\n", - " 0: All Days (M-Su)\n", - " 02: Early AM (12am-6am)\n", - " 15876\n", - " 64\n", - " 107\n", - " 70.409\n", - " 29817.20\n", + " 1: Weekday (M-F)\n", + " 11: 8am (8am-9am)\n", + " 6444\n", + " 62\n", + " 10\n", + " 67.749\n", + " 1139.57\n", " 1.09\n", " False\n", - " 74\n", + " 69\n", " \n", " \n", - " 1317\n", + " 318\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428...\n", + " 1032819756\n", + " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", " Motorway\n", - " 0.177\n", + " 0.109\n", " yes\n", - " 43\n", - " EAST\n", + " 220\n", + " WEST\n", " no\n", " 1: Weekday (M-F)\n", - " 27: 9pm (9pm-10pm)\n", - " 6538\n", - " 60\n", - " 11\n", - " 67.749\n", - " 1156.19\n", - " 1.13\n", + " 18: 2pm (2pm-3pm)\n", + " 7046\n", + " 57\n", + " 8\n", + " 68.596\n", + " 769.90\n", + " 1.19\n", " False\n", - " 67\n", + " 68\n", " \n", " \n", "\n", @@ -4254,70 +3175,70 @@ ], "text/plain": [ " data_periods \\\n", - "1249 Jan 01, 2022 - Dec 31, 2022 \n", - "1024 Jan 01, 2022 - Dec 31, 2022 \n", - "559 Jan 01, 2022 - Dec 31, 2022 \n", - "722 Jan 01, 2022 - Dec 31, 2022 \n", - "1317 Jan 01, 2022 - Dec 31, 2022 \n", + "352 Jan 01, 2022 - Dec 31, 2022 \n", + "434 Jan 01, 2022 - Dec 31, 2022 \n", + "831 Jan 01, 2022 - Dec 31, 2022 \n", + "1301 Jan 01, 2022 - Dec 31, 2022 \n", + "318 Jan 01, 2022 - Dec 31, 2022 \n", "\n", " mode_of_travel zone_id \\\n", - "1249 All Vehicles CVD Plus - StL All Vehicles Volume 1125811810 \n", - "1024 All Vehicles CVD Plus - StL All Vehicles Volume 1118036302 \n", - "559 All Vehicles CVD Plus - StL All Vehicles Volume 1093181568 \n", - "722 All Vehicles CVD Plus - StL All Vehicles Volume 1112062603 \n", - "1317 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", + "352 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", + "434 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", + "831 All Vehicles CVD Plus - StL All Vehicles Volume 1114495634 \n", + "1301 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", + "318 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", "\n", " zone_name road_classification \\\n", - "1249 I 80 / 839972874 / 1 Motorway \n", - "1024 I 80 / 839972875 / 1 Motorway \n", - "559 San Francisco – Oakland Bay Bridge / 50691047 / 1 Motorway \n", - "722 San Francisco – Oakland Bay Bridge / 236348361... Motorway \n", - "1317 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", + "352 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", + "434 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", + "831 I 80 / 395419317 / 1 Motorway \n", + "1301 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", + "318 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", "\n", " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "1249 0.111 yes 85 \n", - "1024 0.006 yes 265 \n", - "559 0.109 yes 40 \n", - "722 1.878 yes 260 \n", - "1317 0.177 yes 43 \n", + "352 0.109 yes 220 \n", + "434 0.073 yes 37 \n", + "831 0.213 yes 82 \n", + "1301 0.177 yes 43 \n", + "318 0.109 yes 220 \n", "\n", " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "1249 EAST no 2: Weekend Day (Sa-Su) \n", - "1024 WEST no 1: Weekday (M-F) \n", - "559 EAST no 0: All Days (M-Su) \n", - "722 WEST no 0: All Days (M-Su) \n", - "1317 EAST no 1: Weekday (M-F) \n", + "352 WEST no 2: Weekend Day (Sa-Su) \n", + "434 EAST no 2: Weekend Day (Sa-Su) \n", + "831 EAST no 0: All Days (M-Su) \n", + "1301 EAST no 1: Weekday (M-F) \n", + "318 WEST no 1: Weekday (M-F) \n", "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "1249 19: 3pm (3pm-4pm) 7876 \n", - "1024 04: 2am (2am-3am) 682 \n", - "559 19: 3pm (3pm-4pm) 9364 \n", - "722 02: Early AM (12am-6am) 15876 \n", - "1317 27: 9pm (9pm-10pm) 6538 \n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "352 22: 5pm (5pm-6pm) 6476 \n", + "434 14: Mid-Day (10am-4pm) 54253 \n", + "831 21: Peak PM (4pm-8pm) 32982 \n", + "1301 11: 8am (8am-9am) 6444 \n", + "318 18: 2pm (2pm-3pm) 7046 \n", "\n", " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "1249 62 7 \n", - "1024 67 2 \n", - "559 40 9 \n", - "722 64 107 \n", - "1317 60 11 \n", + "352 29 14 \n", + "434 52 4 \n", + "831 60 13 \n", + "1301 62 10 \n", + "318 57 8 \n", "\n", " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "1249 70.037 875.09 \n", - "1024 68.762 3.79 \n", - "559 66.047 1020.38 \n", - "722 70.409 29817.20 \n", - "1317 67.749 1156.19 \n", + "352 68.596 707.61 \n", + "434 67.267 3947.53 \n", + "831 69.063 7040.73 \n", + "1301 67.749 1139.57 \n", + "318 68.596 769.90 \n", "\n", " travel_time_index congested_segment _85th_speed_percentile \n", - "1249 1.13 False 70 \n", - "1024 1.02 False 75 \n", - "559 1.64 True 56 \n", - "722 1.09 False 74 \n", - "1317 1.13 False 67 " + "352 2.37 True 55 \n", + "434 1.28 True 64 \n", + "831 1.15 False 68 \n", + "1301 1.09 False 69 \n", + "318 1.19 False 68 " ] }, - "execution_count": 12, + "execution_count": 65, "metadata": {}, "output_type": "execute_result" } @@ -4336,7 +3257,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 66, "id": "da10c3eb-31bd-437e-b546-82472d66f964", "metadata": {}, "outputs": [ @@ -4346,7 +3267,7 @@ "1710" ] }, - "execution_count": 13, + "execution_count": 66, "metadata": {}, "output_type": "execute_result" } @@ -4357,7 +3278,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 67, "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", "metadata": {}, "outputs": [ @@ -4529,7 +3450,7 @@ "18 1135393455 I 80 / 781148922 / 1 90" ] }, - "execution_count": 14, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } @@ -4540,7 +3461,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 68, "id": "cd1ce590-2019-43f0-ba09-786520479ad8", "metadata": {}, "outputs": [ @@ -4758,7 +3679,7 @@ "29 29: 11pm (11pm-12am) 3" ] }, - "execution_count": 15, + "execution_count": 68, "metadata": {}, "output_type": "execute_result" } @@ -4777,7 +3698,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 69, "id": "57c890a6-c667-4917-a090-b85f1aadcad7", "metadata": {}, "outputs": [], @@ -4787,7 +3708,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 70, "id": "0a059c82-c7c8-43b9-92a6-178b42101828", "metadata": {}, "outputs": [ @@ -4797,7 +3718,7 @@ "19" ] }, - "execution_count": 17, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } @@ -4808,7 +3729,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 71, "id": "67213733-9905-42bd-912e-cf943cd66b40", "metadata": {}, "outputs": [ @@ -4980,7 +3901,7 @@ "18 1135393455 I 80 / 781148922 / 1 1" ] }, - "execution_count": 18, + "execution_count": 71, "metadata": {}, "output_type": "execute_result" } @@ -4991,7 +3912,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 72, "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", "metadata": {}, "outputs": [ @@ -5095,7 +4016,7 @@ "1530 1.39 True 67 " ] }, - "execution_count": 19, + "execution_count": 72, "metadata": {}, "output_type": "execute_result" } @@ -5106,7 +4027,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 73, "id": "28292f62-b2ab-46cb-ac08-b728facdfdc0", "metadata": {}, "outputs": [ @@ -5155,126 +4076,126 @@ " \n", " \n", " \n", - " 450\n", + " 1350\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1050419851\n", - " San Francisco – Oakland Bay Bridge / 179235221...\n", + " 1130705657\n", + " San Francisco – Oakland Bay Bridge / 52527662 / 1\n", " Motorway\n", - " 0.004\n", + " 0.104\n", " yes\n", - " 38\n", + " 40\n", " EAST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 161170\n", - " 53\n", - " 2\n", - " 67.840\n", - " 695.17\n", + " 129268\n", + " 51\n", + " 8\n", + " 65.986\n", + " 13419.10\n", " 1.29\n", " True\n", - " 67\n", + " 64\n", " \n", " \n", - " 540\n", + " 630\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1093181568\n", - " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", + " 1112052563\n", + " San Francisco – Oakland Bay Bridge / 236348360...\n", " Motorway\n", - " 0.109\n", + " 0.054\n", " yes\n", - " 40\n", - " EAST\n", + " 231\n", + " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 133795\n", - " 51\n", - " 8\n", - " 66.047\n", - " 14579.50\n", - " 1.30\n", + " 128714\n", + " 52\n", + " 3\n", + " 69.248\n", + " 6900.42\n", + " 1.32\n", " True\n", - " 64\n", + " 69\n", " \n", " \n", - " 0\n", + " 90\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1005898592\n", - " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", + " 1020456908\n", + " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", " Motorway\n", - " 1.985\n", + " 0.077\n", " yes\n", - " 220\n", + " 221\n", " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 108456\n", - " 44\n", - " 179\n", - " 66.336\n", - " 215328.00\n", - " 1.50\n", + " 143382\n", + " 48\n", + " 6\n", + " 68.747\n", + " 11017.90\n", + " 1.42\n", " True\n", - " 63\n", + " 68\n", " \n", " \n", "\n", "" ], "text/plain": [ - " data_periods \\\n", - "450 Jan 01, 2022 - Dec 31, 2022 \n", - "540 Jan 01, 2022 - Dec 31, 2022 \n", - "0 Jan 01, 2022 - Dec 31, 2022 \n", - "\n", - " mode_of_travel zone_id \\\n", - "450 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", - "540 All Vehicles CVD Plus - StL All Vehicles Volume 1093181568 \n", - "0 All Vehicles CVD Plus - StL All Vehicles Volume 1005898592 \n", - "\n", - " zone_name road_classification \\\n", - "450 San Francisco – Oakland Bay Bridge / 179235221... Motorway \n", - "540 San Francisco – Oakland Bay Bridge / 50691047 / 1 Motorway \n", - "0 San Francisco – Oakland Bay Bridge / 8921938 / 1 Motorway \n", - "\n", - " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "450 0.004 yes 38 \n", - "540 0.109 yes 40 \n", - "0 1.985 yes 220 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "450 EAST no 0: All Days (M-Su) \n", - "540 EAST no 0: All Days (M-Su) \n", - "0 WEST no 0: All Days (M-Su) \n", + " data_periods \\\n", + "1350 Jan 01, 2022 - Dec 31, 2022 \n", + "630 Jan 01, 2022 - Dec 31, 2022 \n", + "90 Jan 01, 2022 - Dec 31, 2022 \n", "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "450 00: All Day (12am-12am) 161170 \n", - "540 00: All Day (12am-12am) 133795 \n", - "0 00: All Day (12am-12am) 108456 \n", - "\n", - " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "450 53 2 \n", - "540 51 8 \n", - "0 44 179 \n", - "\n", - " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "450 67.840 695.17 \n", - "540 66.047 14579.50 \n", - "0 66.336 215328.00 \n", - "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "450 1.29 True 67 \n", - "540 1.30 True 64 \n", - "0 1.50 True 63 " + " mode_of_travel zone_id \\\n", + "1350 All Vehicles CVD Plus - StL All Vehicles Volume 1130705657 \n", + "630 All Vehicles CVD Plus - StL All Vehicles Volume 1112052563 \n", + "90 All Vehicles CVD Plus - StL All Vehicles Volume 1020456908 \n", + "\n", + " zone_name road_classification \\\n", + "1350 San Francisco – Oakland Bay Bridge / 52527662 / 1 Motorway \n", + "630 San Francisco – Oakland Bay Bridge / 236348360... Motorway \n", + "90 San Francisco – Oakland Bay Bridge / 23874736 / 1 Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "1350 0.104 yes 40 \n", + "630 0.054 yes 231 \n", + "90 0.077 yes 221 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "1350 EAST no 0: All Days (M-Su) \n", + "630 WEST no 0: All Days (M-Su) \n", + "90 WEST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1350 00: All Day (12am-12am) 129268 \n", + "630 00: All Day (12am-12am) 128714 \n", + "90 00: All Day (12am-12am) 143382 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "1350 51 8 \n", + "630 52 3 \n", + "90 48 6 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "1350 65.986 13419.10 \n", + "630 69.248 6900.42 \n", + "90 68.747 11017.90 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "1350 1.29 True 64 \n", + "630 1.32 True 69 \n", + "90 1.42 True 68 " ] }, - "execution_count": 22, + "execution_count": 73, "metadata": {}, "output_type": "execute_result" } @@ -5285,7 +4206,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 74, "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", "metadata": {}, "outputs": [ @@ -5354,7 +4275,7 @@ "1 50.333333 41.777778 123029.777778 1107268 " ] }, - "execution_count": 29, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -5368,7 +4289,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 75, "id": "778d58f0-25b7-4cf7-b60a-10e773055f48", "metadata": {}, "outputs": [], @@ -5410,7 +4331,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 76, "id": "29eab191-4eaa-445c-b444-49048135ef3b", "metadata": {}, "outputs": [], @@ -5432,7 +4353,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 77, "id": "896b63a9-b881-418a-ba40-dbea63f81614", "metadata": {}, "outputs": [], @@ -5446,7 +4367,7 @@ }, { "cell_type": "code", - "execution_count": 154, + "execution_count": 78, "id": "cac29684-36ac-488b-b2d1-044ab5ef86c0", "metadata": {}, "outputs": [ @@ -5482,28 +4403,28 @@ " \n", " \n", " \n", - " 34\n", - " WEST\n", - " 2: Weekend Day (Sa-Su)\n", + " 10\n", + " EAST\n", + " 1: Weekday (M-F)\n", " 21: Peak PM (4pm-8pm)\n", - " 40.222222\n", - " 54.222222\n", - " 23846.222222\n", - " 214616\n", + " 49.1\n", + " 38.3\n", + " 35673.8\n", + " 356738\n", " \n", " \n", "\n", "" ], "text/plain": [ - " zone_cardinal_direction day_type day_part \\\n", - "34 WEST 2: Weekend Day (Sa-Su) 21: Peak PM (4pm-8pm) \n", + " zone_cardinal_direction day_type day_part \\\n", + "10 EAST 1: Weekday (M-F) 21: Peak PM (4pm-8pm) \n", "\n", - " avg_speed avg_travel_time avg_volume sum_volume \n", - "34 40.222222 54.222222 23846.222222 214616 " + " avg_speed avg_travel_time avg_volume sum_volume \n", + "10 49.1 38.3 35673.8 356738 " ] }, - "execution_count": 154, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -5514,7 +4435,7 @@ }, { "cell_type": "code", - "execution_count": 157, + "execution_count": 79, "id": "637afffc-560f-4485-985a-d6ee73dd65a7", "metadata": {}, "outputs": [ @@ -5523,23 +4444,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 16, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -1130,8 +1341,11 @@ " .encode(\n", " x=alt.X(\"primary_mode\"),\n", " y=alt.Y(\"n\"),\n", - " color=alt.Color(\"trip_taker_race_ethnicity\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", - " )\n", + " color=alt.Color(\"trip_taker_race_ethnicity\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=race_ethnicity_by_mode[\"trip_taker_race_ethnicity\"].unique().tolist())\n", + " ),\n", + " tooltip=race_ethnicity_by_mode.columns.tolist())\n", + " \n", " .properties(\n", " width=800,\n", " height=300)\n", @@ -1149,17 +1363,69 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, + "id": "500ad806-51ed-47e9-88a5-fc8a41edd7aa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Transit Mode Splits

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Transit Mode Splits

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 26, "id": "d8cd6354-0433-4134-ad6e-9df92122cbd2", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/html": [ + "Looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"Looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count.\")) \n" + ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 27, "id": "261d7f48-f7c3-4ea7-a526-6f813ca16ede", "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count = (r_trips\n", + " >>filter(_.primary_mode==\"public_transit\")\n", + " >>group_by(_.primary_mode, _.transit_submode)\n", + " >>count(_.transit_agency)\n", + " >>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "e4516beb-8277-4fd4-aed1-23af65fc4a28", + "metadata": {}, "outputs": [ { "data": { @@ -1190,166 +1456,166 @@ " \n", " \n", " \n", - " 4\n", + " 0\n", " public_transit\n", " bus\n", " AC TRANSIT\n", " 2788\n", " \n", " \n", - " 16\n", + " 12\n", " public_transit\n", " bus, bus\n", " San Francisco Municipal Transportation Agency,...\n", " 632\n", " \n", " \n", - " 12\n", + " 8\n", " public_transit\n", " bus, bus\n", " AC TRANSIT, San Francisco Municipal Transporta...\n", " 516\n", " \n", " \n", - " 10\n", + " 6\n", " public_transit\n", " bus, bus\n", " AC TRANSIT, AC TRANSIT\n", " 263\n", " \n", " \n", - " 79\n", + " 75\n", " public_transit\n", " bus, light_rail\n", " AC TRANSIT, San Francisco Municipal Transporta...\n", " 253\n", " \n", " \n", - " 18\n", - " public_transit\n", - " bus, bus\n", - " San Francisco Municipal Transportation Agency,...\n", - " 234\n", - " \n", - " \n", - " 7\n", - " public_transit\n", - " bus\n", - " San Francisco Municipal Transportation Agency\n", - " 197\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", + " ...\n", " \n", " \n", - " 120\n", + " 128\n", " public_transit\n", - " light_rail, bus, bus\n", - " San Francisco Municipal Transportation Agency,...\n", - " 91\n", + " rail, bus\n", + " Caltrain, SamTrans\n", + " 1\n", " \n", " \n", - " 35\n", + " 130\n", " public_transit\n", - " bus, bus, bus\n", - " San Francisco Municipal Transportation Agency,...\n", - " 79\n", + " rail, bus, bus\n", + " Amtrak, AC TRANSIT, AC TRANSIT\n", + " 1\n", " \n", " \n", - " 37\n", + " 133\n", " public_transit\n", - " bus, bus, bus\n", - " San Francisco Municipal Transportation Agency,...\n", - " 69\n", + " rail, light_rail, bus\n", + " Caltrain, San Francisco Municipal Transportati...\n", + " 1\n", " \n", " \n", - " 80\n", + " 136\n", " public_transit\n", - " bus, light_rail\n", - " San Francisco Municipal Transportation Agency,...\n", - " 63\n", + " rail, subway, bus, bus\n", + " Caltrain, Bay Area Rapid Transit, San Francisc...\n", + " 1\n", " \n", " \n", - " 143\n", + " 141\n", " public_transit\n", - " subway, bus\n", + " subway, bus, bus, bus\n", " Bay Area Rapid Transit, San Francisco Municipa...\n", - " 59\n", - " \n", - " \n", - " 98\n", - " public_transit\n", - " bus, subway\n", - " San Francisco Municipal Transportation Agency,...\n", - " 52\n", - " \n", - " \n", - " 117\n", - " public_transit\n", - " light_rail, bus\n", - " San Francisco Municipal Transportation Agency,...\n", - " 50\n", - " \n", - " \n", - " 28\n", - " public_transit\n", - " bus, bus, bus\n", - " AC TRANSIT, San Francisco Municipal Transporta...\n", - " 44\n", + " 1\n", " \n", " \n", "\n", + "

144 rows × 4 columns

\n", "" ], "text/plain": [ - " primary_mode transit_submode \\\n", - "4 public_transit bus \n", - "16 public_transit bus, bus \n", - "12 public_transit bus, bus \n", - "10 public_transit bus, bus \n", - "79 public_transit bus, light_rail \n", - "18 public_transit bus, bus \n", - "7 public_transit bus \n", - "120 public_transit light_rail, bus, bus \n", - "35 public_transit bus, bus, bus \n", - "37 public_transit bus, bus, bus \n", - "80 public_transit bus, light_rail \n", - "143 public_transit subway, bus \n", - "98 public_transit bus, subway \n", - "117 public_transit light_rail, bus \n", - "28 public_transit bus, bus, bus \n", + " primary_mode transit_submode \\\n", + "0 public_transit bus \n", + "12 public_transit bus, bus \n", + "8 public_transit bus, bus \n", + "6 public_transit bus, bus \n", + "75 public_transit bus, light_rail \n", + ".. ... ... \n", + "128 public_transit rail, bus \n", + "130 public_transit rail, bus, bus \n", + "133 public_transit rail, light_rail, bus \n", + "136 public_transit rail, subway, bus, bus \n", + "141 public_transit subway, bus, bus, bus \n", "\n", " transit_agency n \n", - "4 AC TRANSIT 2788 \n", - "16 San Francisco Municipal Transportation Agency,... 632 \n", - "12 AC TRANSIT, San Francisco Municipal Transporta... 516 \n", - "10 AC TRANSIT, AC TRANSIT 263 \n", - "79 AC TRANSIT, San Francisco Municipal Transporta... 253 \n", - "18 San Francisco Municipal Transportation Agency,... 234 \n", - "7 San Francisco Municipal Transportation Agency 197 \n", - "120 San Francisco Municipal Transportation Agency,... 91 \n", - "35 San Francisco Municipal Transportation Agency,... 79 \n", - "37 San Francisco Municipal Transportation Agency,... 69 \n", - "80 San Francisco Municipal Transportation Agency,... 63 \n", - "143 Bay Area Rapid Transit, San Francisco Municipa... 59 \n", - "98 San Francisco Municipal Transportation Agency,... 52 \n", - "117 San Francisco Municipal Transportation Agency,... 50 \n", - "28 AC TRANSIT, San Francisco Municipal Transporta... 44 " + "0 AC TRANSIT 2788 \n", + "12 San Francisco Municipal Transportation Agency,... 632 \n", + "8 AC TRANSIT, San Francisco Municipal Transporta... 516 \n", + "6 AC TRANSIT, AC TRANSIT 263 \n", + "75 AC TRANSIT, San Francisco Municipal Transporta... 253 \n", + ".. ... ... \n", + "128 Caltrain, SamTrans 1 \n", + "130 Amtrak, AC TRANSIT, AC TRANSIT 1 \n", + "133 Caltrain, San Francisco Municipal Transportati... 1 \n", + "136 Caltrain, Bay Area Rapid Transit, San Francisc... 1 \n", + "141 Bay Area Rapid Transit, San Francisco Municipa... 1 \n", + "\n", + "[144 rows x 4 columns]" ] }, - "execution_count": 40, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count. \n", - "\n", - "(r_trips>>group_by(_.primary_mode, _.transit_submode)>>count(_.transit_agency)>>filter(_.transit_agency.notnull())>>arrange(-_.n)).head(15)" + "ptt_agency_count" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 29, + "id": "727511b8-3141-40e4-b654-30aaae8200d9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Most common transit mode combinations

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Most common transit mode combinations

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 30, "id": "f3c31371-899f-4474-85b6-86e78e89209b", "metadata": {}, + "outputs": [], + "source": [ + "ptt_modes = (r_trips\n", + " >>filter(_.primary_mode ==\"public_transit\")\n", + " >>count(_.transit_submode)>>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "657ff2f3-0d0d-419d-b3d5-512212897fb1", + "metadata": {}, "outputs": [ { "data": { @@ -1408,86 +1674,673 @@ " 76\n", " \n", " \n", - " 55\n", - " subway, bus\n", - " 66\n", + " 55\n", + " subway, bus\n", + " 66\n", + " \n", + " \n", + " 32\n", + " bus, subway\n", + " 63\n", + " \n", + " \n", + " 14\n", + " bus, bus, light_rail\n", + " 49\n", + " \n", + " \n", + " 33\n", + " bus, subway, bus\n", + " 46\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " transit_submode n\n", + "0 bus 2999\n", + "1 bus, bus 1706\n", + "21 bus, light_rail 316\n", + "2 bus, bus, bus 302\n", + "41 light_rail, bus, bus 127\n", + "40 light_rail, bus 76\n", + "55 subway, bus 66\n", + "32 bus, subway 63\n", + "14 bus, bus, light_rail 49\n", + "33 bus, subway, bus 46" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ptt_modes.head(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "80daf7a1-b947-469c-b3b0-09d0302714b7", + "metadata": {}, + "outputs": [], + "source": [ + "##### unnesting the transit submode and agencies to get counts. " + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "dc915bd0-82cf-4216-b3f5-aac442b1b1f1", + "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", + "
primary_modetransit_submodetransit_agencyn
0public_transitbusAC TRANSIT2788
12public_transitbus, busSan Francisco Municipal Transportation Agency,...632
8public_transitbus, busAC TRANSIT, San Francisco Municipal Transporta...516
6public_transitbus, busAC TRANSIT, AC TRANSIT263
75public_transitbus, light_railAC TRANSIT, San Francisco Municipal Transporta...253
\n", + "
" + ], + "text/plain": [ + " primary_mode transit_submode \\\n", + "0 public_transit bus \n", + "12 public_transit bus, bus \n", + "8 public_transit bus, bus \n", + "6 public_transit bus, bus \n", + "75 public_transit bus, light_rail \n", + "\n", + " transit_agency n \n", + "0 AC TRANSIT 2788 \n", + "12 San Francisco Municipal Transportation Agency,... 632 \n", + "8 AC TRANSIT, San Francisco Municipal Transporta... 516 \n", + "6 AC TRANSIT, AC TRANSIT 263 \n", + "75 AC TRANSIT, San Francisco Municipal Transporta... 253 " + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ptt_agency_count.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "eb27ab6b-6244-406f-b41a-55503a77521a", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['transit_submode'] = ptt_agency_count['transit_submode'].astype(str)\n", + "ptt_agency_count['transit_agency'] = ptt_agency_count['transit_agency'].astype(str)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "92ed5077-3524-4c39-8cf4-bf1b7922da2a", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['n_modes_taken'] = ptt_agency_count.transit_submode.apply(lambda x: len(x.split()))" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "c42ee93d-54ee-4fa5-97cc-447339565d4a", + "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", + "
primary_modetransit_submodetransit_agencynn_modes_taken
57public_transitbus, bus, bus, rail, bus, busSan Joaquin Regional Transit District (RTD), S...16
48public_transitbus, bus, bus, bus, busSan Francisco Municipal Transportation Agency,...15
49public_transitbus, bus, bus, bus, busVTA, SamTrans, AC TRANSIT, SolTrans, Fairfield...15
50public_transitbus, bus, bus, bus, light_railAC TRANSIT, SolTrans, SolTrans, Sacramento Reg...15
51public_transitbus, bus, bus, bus, railSan Francisco Municipal Transportation Agency,...15
..................
1public_transitbusMarin Transit41
137public_transitsubwayBay Area Rapid Transit41
4public_transitbusSolTrans31
2public_transitbusSamTrans11
112public_transitlight_railVTA11
\n", + "

144 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " primary_mode transit_submode \\\n", + "57 public_transit bus, bus, bus, rail, bus, bus \n", + "48 public_transit bus, bus, bus, bus, bus \n", + "49 public_transit bus, bus, bus, bus, bus \n", + "50 public_transit bus, bus, bus, bus, light_rail \n", + "51 public_transit bus, bus, bus, bus, rail \n", + ".. ... ... \n", + "1 public_transit bus \n", + "137 public_transit subway \n", + "4 public_transit bus \n", + "2 public_transit bus \n", + "112 public_transit light_rail \n", + "\n", + " transit_agency n n_modes_taken \n", + "57 San Joaquin Regional Transit District (RTD), S... 1 6 \n", + "48 San Francisco Municipal Transportation Agency,... 1 5 \n", + "49 VTA, SamTrans, AC TRANSIT, SolTrans, Fairfield... 1 5 \n", + "50 AC TRANSIT, SolTrans, SolTrans, Sacramento Reg... 1 5 \n", + "51 San Francisco Municipal Transportation Agency,... 1 5 \n", + ".. ... .. ... \n", + "1 Marin Transit 4 1 \n", + "137 Bay Area Rapid Transit 4 1 \n", + "4 SolTrans 3 1 \n", + "2 SamTrans 1 1 \n", + "112 VTA 1 1 \n", + "\n", + "[144 rows x 5 columns]" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ptt_agency_count>>arrange(-_.n_modes_taken)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d93bd0e-f30d-4a53-9077-25818eef0cf7", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "cb12d509-d786-458c-894a-193c80666bb6", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['agency_count'] = ptt_agency_count.transit_agency.apply(lambda x: len(x.split(\", \")))" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "4d8f7802-cecd-485c-8732-6db84ec91061", + "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", "
primary_modetransit_submodetransit_agencynn_modes_takenagency_count
0public_transitbusAC TRANSIT278811
12public_transitbus, busSan Francisco Municipal Transportation Agency, AC TRANSIT63222
8public_transitbus, busAC TRANSIT, San Francisco Municipal Transportation Agency51622
32bus, subway636public_transitbus, busAC TRANSIT, AC TRANSIT26322
14bus, bus, light_rail4975public_transitbus, light_railAC TRANSIT, San Francisco Municipal Transportation Agency25322
33bus, subway, bus46.....................
22bus, light_rail, bus35128public_transitrail, busCaltrain, SamTrans122
18bus, bus, subway34130public_transitrail, bus, busAmtrak, AC TRANSIT, AC TRANSIT133
39light_rail28133public_transitrail, light_rail, busCaltrain, San Francisco Municipal Transportation Agency, AC TRANSIT133
3bus, bus, bus, bus25136public_transitrail, subway, bus, busCaltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT144
59NaN24141public_transitsubway, bus, bus, busBay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT144
\n", + "

144 rows × 6 columns

\n", "
" ], "text/plain": [ - " transit_submode n\n", - "0 bus 2999\n", - "1 bus, bus 1706\n", - "21 bus, light_rail 316\n", - "2 bus, bus, bus 302\n", - "41 light_rail, bus, bus 127\n", - "40 light_rail, bus 76\n", - "55 subway, bus 66\n", - "32 bus, subway 63\n", - "14 bus, bus, light_rail 49\n", - "33 bus, subway, bus 46\n", - "22 bus, light_rail, bus 35\n", - "18 bus, bus, subway 34\n", - "39 light_rail 28\n", - "3 bus, bus, bus, bus 25\n", - "59 NaN 24" + " primary_mode transit_submode \\\n", + "0 public_transit bus \n", + "12 public_transit bus, bus \n", + "8 public_transit bus, bus \n", + "6 public_transit bus, bus \n", + "75 public_transit bus, light_rail \n", + ".. ... ... \n", + "128 public_transit rail, bus \n", + "130 public_transit rail, bus, bus \n", + "133 public_transit rail, light_rail, bus \n", + "136 public_transit rail, subway, bus, bus \n", + "141 public_transit subway, bus, bus, bus \n", + "\n", + " transit_agency \\\n", + "0 AC TRANSIT \n", + "12 San Francisco Municipal Transportation Agency, AC TRANSIT \n", + "8 AC TRANSIT, San Francisco Municipal Transportation Agency \n", + "6 AC TRANSIT, AC TRANSIT \n", + "75 AC TRANSIT, San Francisco Municipal Transportation Agency \n", + ".. ... \n", + "128 Caltrain, SamTrans \n", + "130 Amtrak, AC TRANSIT, AC TRANSIT \n", + "133 Caltrain, San Francisco Municipal Transportation Agency, AC TRANSIT \n", + "136 Caltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT \n", + "141 Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT \n", + "\n", + " n n_modes_taken agency_count \n", + "0 2788 1 1 \n", + "12 632 2 2 \n", + "8 516 2 2 \n", + "6 263 2 2 \n", + "75 253 2 2 \n", + ".. ... ... ... \n", + "128 1 2 2 \n", + "130 1 3 3 \n", + "133 1 3 3 \n", + "136 1 4 4 \n", + "141 1 4 4 \n", + "\n", + "[144 rows x 6 columns]" ] }, - "execution_count": 18, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "## most common transit mode combinations\n", - "(r_trips>>filter(_.primary_mode ==\"public_transit\")>>count(_.transit_submode)>>arrange(-_.n)).head(15)" + "ptt_agency_count" ] }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, + "id": "ab709433-dea7-42a0-9a4b-086a9b4e2db5", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fb8565b9-989a-459a-bede-433de30252e7", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "27e8c32c-4a46-4016-86ea-6ecd999f28fb", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0607c6fb-5125-49f3-9a66-5347f5599ea3", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b015001-6143-4aad-8137-d353d7d443d2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "91273d26-1fd1-42a1-b829-a77398c606fc", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bd200d7-c0b9-4649-adf1-e025d216328b", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e8f5f457-ce9f-4bfb-99f6-82e6eb7d11f0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b48b976-e4c7-4b8f-81d0-f3a54ed33a5e", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ebf84d06-954c-49dd-934b-09bc73a36e66", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f38660fb-344d-4695-80d1-2c621400292d", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a31531d3-257a-44e4-9a64-3bcdea0ccd92", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0dd42b8d-b8d5-4cc4-bb62-cfef6c03c7e8", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a59f170f-b2e0-41b3-ae7a-1ae4eca12596", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 30, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -1500,7 +2353,30 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 31, + "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Trips by Resident Type

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Trips by Resident Type

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 32, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -1602,7 +2478,7 @@ "8 public_transit visitor 47" ] }, - "execution_count": 49, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -1613,7 +2489,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 33, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -1622,23 +2498,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 50, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1703,11 +2579,13 @@ " .encode(\n", " x=alt.X(\"primary_mode\"),\n", " y=alt.Y(\"number_trips\"),\n", - " color=alt.Color(\"trip_taker_resident_type\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", - " )\n", + " color=alt.Color(\"trip_taker_resident_type\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=trip_by_res_type[\"trip_taker_resident_type\"].unique().tolist())\n", + " ),\n", + " tooltip=trip_by_res_type.columns.tolist())\n", " .properties(\n", " width=800,\n", - " height=300)\n", + " height=500)\n", " )\n", "chart " ] @@ -1722,7 +2600,30 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 34, + "id": "878c5c8e-18c3-456a-b641-67ad010f5101", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Unique Household Ids

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Unique Household Ids

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 35, "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", "metadata": {}, "outputs": [ @@ -1829,7 +2730,7 @@ "[262323 rows x 2 columns]" ] }, - "execution_count": 19, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -1840,7 +2741,30 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 36, + "id": "eb9780a3-b996-45af-9cc3-b41629ec0e55", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Checking one household id

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Checking one household id

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 37, "id": "6fc3be54-b8dc-4cf8-893e-565ffa02934d", "metadata": {}, "outputs": [ @@ -1928,9 +2852,9 @@ " \n", " \n", " \n", - " 257752\n", - " open_space\n", - " 13\n", + " 594862\n", + " single_family\n", + " 14\n", " indo_european\n", " 179.03 (San Francisco, CA)\n", " 8194219563640751815\n", @@ -1938,49 +2862,49 @@ " 1 (Tract 179.03, San Francisco, CA)\n", " California\n", " California\n", - " white_not_hispanic_or_latino\n", + " asian_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 34.0\n", - " 14240036214978350700\n", - " 1 (Tract 125.03, San Francisco, CA)\n", + " 22.0\n", + " 7017187216760344743\n", + " 1 (Tract 4028.01, Alameda, CA)\n", " retail\n", " remote\n", " California\n", - " San Francisco\n", - " 2 (Tract 231.03, San Francisco, CA)\n", - " 125.03 (San Francisco, CA)\n", + " Alameda\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " 4028.01 (Alameda, CA)\n", " 1200990.0\n", " 1 (Tract 179.03, San Francisco, CA)\n", " worked_from_home\n", " three_plus\n", " auto_passenger\n", - " recreation\n", + " work_from_home\n", " single_family\n", " NaN\n", " California\n", " 10.0\n", " San Francisco\n", - " mixed_use\n", - " naics31_33\n", + " retail\n", + " naics62\n", " renter\n", " unknown_fuel_type\n", " 179.03 (San Francisco, CA)\n", - " 231.03 (San Francisco, CA)\n", + " 179.03 (San Francisco, CA)\n", " bachelors_degree\n", - " 07:53:00\n", - " 141119.0\n", + " 16:09:00\n", + " 76878.0\n", " employed\n", - " eat\n", - " mixed_use\n", + " shop\n", + " single_family\n", " San Francisco\n", - " 4.7\n", + " 7.6\n", " not_attending_school\n", " San Francisco\n", - " 4746831412975349070\n", - " 08:06:39\n", + " 1325181746552868554\n", + " 16:23:22\n", " \n", " \n", "\n", @@ -1988,80 +2912,79 @@ ], "text/plain": [ " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "257752 open_space 13 indo_european \n", + "594862 single_family 14 indo_european \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "257752 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "594862 179.03 (San Francisco, CA) 8194219563640751815 female \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "257752 1 (Tract 179.03, San Francisco, CA) California \n", + "594862 1 (Tract 179.03, San Francisco, CA) California \n", "\n", " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", - "257752 California white_not_hispanic_or_latino NaN \n", + "594862 California asian_not_hispanic_or_latino NaN \n", "\n", " transit_route trip_taker_resident_type vehicle_type \\\n", - "257752 NaN core unknown_vehicle_type \n", + "594862 NaN core unknown_vehicle_type \n", "\n", - " trip_taker_age activity_id \\\n", - "257752 34.0 14240036214978350700 \n", + " trip_taker_age activity_id destination_bgrp_2020 \\\n", + "594862 22.0 7017187216760344743 1 (Tract 4028.01, Alameda, CA) \n", "\n", - " destination_bgrp_2020 destination_building_use \\\n", - "257752 1 (Tract 125.03, San Francisco, CA) retail \n", + " destination_building_use trip_taker_wfh destination_st_2020 \\\n", + "594862 retail remote California \n", "\n", - " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", - "257752 remote California San Francisco \n", + " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", + "594862 Alameda 1 (Tract 179.03, San Francisco, CA) \n", "\n", - " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", - "257752 2 (Tract 231.03, San Francisco, CA) 125.03 (San Francisco, CA) \n", + " destination_trct_2020 trip_taker_household_income \\\n", + "594862 4028.01 (Alameda, CA) 1200990.0 \n", "\n", - " trip_taker_household_income origin_bgrp_2020 \\\n", - "257752 1200990.0 1 (Tract 179.03, San Francisco, CA) \n", + " origin_bgrp_2020 trip_taker_commute_mode \\\n", + "594862 1 (Tract 179.03, San Francisco, CA) worked_from_home \n", "\n", - " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", - "257752 worked_from_home three_plus auto_passenger \n", + " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", + "594862 three_plus auto_passenger work_from_home \n", "\n", - " previous_trip_purpose trip_taker_building_type transit_submode \\\n", - "257752 recreation single_family NaN \n", + " trip_taker_building_type transit_submode trip_taker_work_st_2020 \\\n", + "594862 single_family NaN California \n", "\n", - " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", - "257752 California 10.0 San Francisco \n", + " trip_taker_household_size origin_cty_2020 destination_land_use \\\n", + "594862 10.0 San Francisco retail \n", "\n", - " destination_land_use trip_taker_industry trip_taker_tenure \\\n", - "257752 mixed_use naics31_33 renter \n", + " trip_taker_industry trip_taker_tenure vehicle_fuel_type \\\n", + "594862 naics62 renter unknown_fuel_type \n", "\n", - " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "257752 unknown_fuel_type 179.03 (San Francisco, CA) \n", + " trip_taker_home_trct_2020 trip_taker_work_trct_2020 \\\n", + "594862 179.03 (San Francisco, CA) 179.03 (San Francisco, CA) \n", "\n", - " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", - "257752 231.03 (San Francisco, CA) bachelors_degree 07:53:00 \n", + " trip_taker_education trip_start_time trip_taker_individual_income \\\n", + "594862 bachelors_degree 16:09:00 76878.0 \n", "\n", - " trip_taker_individual_income trip_taker_employment_status \\\n", - "257752 141119.0 employed \n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "594862 employed shop single_family \n", "\n", - " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", - "257752 eat mixed_use San Francisco \n", + " trip_taker_work_cty_2020 trip_distance_miles \\\n", + "594862 San Francisco 7.6 \n", "\n", - " trip_distance_miles trip_taker_school_grade_attending \\\n", - "257752 4.7 not_attending_school \n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "594862 not_attending_school San Francisco \n", "\n", - " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", - "257752 San Francisco 4746831412975349070 08:06:39 " + " trip_taker_person_id trip_end_time \n", + "594862 1325181746552868554 16:23:22 " ] }, - "execution_count": 57, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "## checking one household id\n", "print(len(r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)))\n", "(r_trips>>filter(_.trip_taker_household_id == 8194219563640751815)).sample()" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 38, "id": "4eccfdf8-429e-43df-899e-f7d77e051831", "metadata": {}, "outputs": [ @@ -2174,7 +3097,7 @@ "6 10.0 6 " ] }, - "execution_count": 21, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -2211,7 +3134,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 39, "id": "dea31a60-e986-41e7-b31b-1e5403c9e041", "metadata": {}, "outputs": [ @@ -2219,7 +3142,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_265/1951040339.py:1: DtypeWarning: Columns (25) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_320/1951040339.py:1: DtypeWarning: Columns (25) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_ppl = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_ppl}\"))\n" ] } @@ -2228,9 +3151,17 @@ "r_ppl = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_ppl}\"))" ] }, + { + "cell_type": "markdown", + "id": "2cf7ed4b-7524-4e9a-858a-857fcf70950c", + "metadata": {}, + "source": [ + "replica people dataframe sample" + ] + }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 40, "id": "42bc1220-b404-4aca-8214-43992c55163b", "metadata": {}, "outputs": [ @@ -2286,239 +3217,218 @@ " \n", " \n", " \n", - " 293778\n", - " 2172319439732228215\n", - " Visitor (no work/school location)\n", - " NaN\n", - " visitor\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " Visitor (no home location)\n", - " Visitor (no home location)\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " Visitor (no home location)\n", - " NaN\n", - " NaN\n", - " Visitor (no home location)\n", - " \n", - " NaN\n", - " \n", - " \n", - " 187086\n", - " 1232617019565993485\n", - " Does not have work/school location\n", - " 357385.0\n", + " 126764\n", + " 13176772315533876677\n", + " California\n", + " 275131.0\n", " core\n", " asian_pacific\n", - " three_plus\n", + " two\n", " asian_not_hispanic_or_latino\n", - " no_school\n", - " Does not have work/school location\n", - " unemployed_under_16_not_in_labor_force\n", - " San Mateo\n", - " 6004.02 (San Mateo, CA)\n", + " bachelors_degree\n", + " 3 (Tract 117, San Francisco, CA)\n", + " in_person\n", + " Alameda\n", + " 4415.21 (Alameda, CA)\n", " owner\n", - " not_working\n", - " Does not have work/school location\n", + " naics54\n", + " 117 (San Francisco, CA)\n", " not_attending_school\n", " single_family\n", - " other_travel_mode\n", - " not_in_labor_force\n", - " Does not have work/school location\n", - " 0.0\n", + " public_transit\n", + " employed\n", + " San Francisco\n", + " 207687.0\n", " California\n", " male\n", - " 5.0\n", - " 1 (Tract 6004.02, San Mateo, CA)\n", - " 12769569955729229579\n", - " 70.0\n", + " 3.0\n", + " 3 (Tract 4415.21, Alameda, CA)\n", + " 4405505003628472113\n", + " 61.0\n", " \n", " \n", - " 205818\n", - " 11389470679660779632\n", + " 231078\n", + " 5369653974752218591\n", " California\n", - " 20598.0\n", + " 67771.0\n", " core\n", - " english\n", + " spanish\n", " one\n", - " white_not_hispanic_or_latino\n", - " advanced_degree\n", - " 1 (Tract 5064.01, Santa Clara, CA)\n", + " hispanic_or_latino_origin\n", + " k_12\n", + " 3 (Tract 254.01, San Francisco, CA)\n", " in_person\n", - " San Francisco\n", - " 125.03 (San Francisco, CA)\n", + " Contra Costa\n", + " 3072.02 (Contra Costa, CA)\n", " renter\n", - " naics56\n", - " 5064.01 (Santa Clara, CA)\n", + " naics23\n", + " 254.01 (San Francisco, CA)\n", " not_attending_school\n", " multiple_units\n", " private_auto\n", " employed\n", - " Santa Clara\n", - " 20598.0\n", + " San Francisco\n", + " 37165.0\n", " California\n", " male\n", - " 1.0\n", - " 1 (Tract 125.03, San Francisco, CA)\n", - " 6412401918090088790\n", - " 62.0\n", + " 2.0\n", + " 3 (Tract 3072.02, Contra Costa, CA)\n", + " 2520287356701498339\n", + " 35.0\n", " \n", " \n", - " 24868\n", - " 16082366692397729873\n", - " Does not have work/school location\n", - " 16724.0\n", + " 45631\n", + " 12611646703074941567\n", + " California\n", + " 223094.0\n", " core\n", - " spanish\n", - " one\n", - " hispanic_or_latino_origin\n", - " bachelors_degree\n", - " Does not have work/school location\n", - " unemployed_under_16_not_in_labor_force\n", + " english\n", + " two\n", + " two_races_not_hispanic_or_latino\n", + " some_college\n", + " 2 (Tract 6023, San Mateo, CA)\n", + " in_person\n", " Alameda\n", - " 4040 (Alameda, CA)\n", + " 4213 (Alameda, CA)\n", " renter\n", - " not_working\n", - " Does not have work/school location\n", + " naics5412\n", + " 6023 (San Mateo, CA)\n", " not_attending_school\n", - " multiple_units\n", - " other_travel_mode\n", - " not_in_labor_force\n", - " Does not have work/school location\n", - " 16724.0\n", + " single_family\n", + " private_auto\n", + " employed\n", + " San Mateo\n", + " 153083.0\n", " California\n", - " female\n", - " 1.0\n", - " 2 (Tract 4040, Alameda, CA)\n", - " 245245365939855220\n", - " 76.0\n", + " male\n", + " 3.0\n", + " 3 (Tract 4213, Alameda, CA)\n", + " 17976817071532499180\n", + " 35.0\n", " \n", " \n", - " 15669\n", - " 3127754813479201959\n", + " 106775\n", + " 8691085808549329285\n", " California\n", - " 205985.0\n", + " 22658.0\n", " core\n", " english\n", - " two\n", + " one\n", " white_not_hispanic_or_latino\n", " advanced_degree\n", - " 2 (Tract 134.01, San Francisco, CA)\n", + " 3 (Tract 607.01, San Francisco, CA)\n", " in_person\n", " Alameda\n", - " 4009 (Alameda, CA)\n", + " 4037.01 (Alameda, CA)\n", " renter\n", - " not_working\n", - " 134.01 (San Francisco, CA)\n", + " naics54192\n", + " 607.01 (San Francisco, CA)\n", + " graduate\n", + " multiple_units\n", + " private_auto\n", + " employed\n", + " San Francisco\n", + " 22658.0\n", + " California\n", + " female\n", + " 1.0\n", + " 2 (Tract 4037.01, Alameda, CA)\n", + " 8374180285393209524\n", + " 25.0\n", + " \n", + " \n", + " 251509\n", + " 16288548793878627261\n", + " California\n", + " 614473.0\n", + " core\n", + " spanish\n", + " three_plus\n", + " white_not_hispanic_or_latino\n", + " advanced_degree\n", + " 2 (Tract 105, San Francisco, CA)\n", + " in_person\n", + " Contra Costa\n", + " 3462.06 (Contra Costa, CA)\n", + " owner\n", + " naics52\n", + " 105 (San Francisco, CA)\n", " not_attending_school\n", " single_family\n", - " private_auto\n", + " public_transit\n", " employed\n", " San Francisco\n", - " 102992.0\n", + " 614473.0\n", " California\n", " male\n", " 3.0\n", - " 1 (Tract 4009, Alameda, CA)\n", - " 11929379462304966723\n", - " 32.0\n", + " 1 (Tract 3462.06, Contra Costa, CA)\n", + " 16466378101748887324\n", + " 54.0\n", " \n", " \n", "\n", "" ], "text/plain": [ - " person_id work_st_2020 \\\n", - "293778 2172319439732228215 Visitor (no work/school location) \n", - "187086 1232617019565993485 Does not have work/school location \n", - "205818 11389470679660779632 California \n", - "24868 16082366692397729873 Does not have work/school location \n", - "15669 3127754813479201959 California \n", - "\n", - " household_income resident_type language available_vehicles \\\n", - "293778 NaN visitor NaN NaN \n", - "187086 357385.0 core asian_pacific three_plus \n", - "205818 20598.0 core english one \n", - "24868 16724.0 core spanish one \n", - "15669 205985.0 core english two \n", - "\n", - " race_ethnicity education \\\n", - "293778 NaN NaN \n", - "187086 asian_not_hispanic_or_latino no_school \n", - "205818 white_not_hispanic_or_latino advanced_degree \n", - "24868 hispanic_or_latino_origin bachelors_degree \n", - "15669 white_not_hispanic_or_latino advanced_degree \n", - "\n", - " work_bgrp_2020 \\\n", - "293778 Visitor (no work/school location) \n", - "187086 Does not have work/school location \n", - "205818 1 (Tract 5064.01, Santa Clara, CA) \n", - "24868 Does not have work/school location \n", - "15669 2 (Tract 134.01, San Francisco, CA) \n", - "\n", - " wfh home_cty_2020 \\\n", - "293778 NaN Visitor (no home location) \n", - "187086 unemployed_under_16_not_in_labor_force San Mateo \n", - "205818 in_person San Francisco \n", - "24868 unemployed_under_16_not_in_labor_force Alameda \n", - "15669 in_person Alameda \n", - "\n", - " home_trct_2020 tenure industry \\\n", - "293778 Visitor (no home location) NaN NaN \n", - "187086 6004.02 (San Mateo, CA) owner not_working \n", - "205818 125.03 (San Francisco, CA) renter naics56 \n", - "24868 4040 (Alameda, CA) renter not_working \n", - "15669 4009 (Alameda, CA) renter not_working \n", - "\n", - " work_trct_2020 school_grade_attending \\\n", - "293778 Visitor (no work/school location) NaN \n", - "187086 Does not have work/school location not_attending_school \n", - "205818 5064.01 (Santa Clara, CA) not_attending_school \n", - "24868 Does not have work/school location not_attending_school \n", - "15669 134.01 (San Francisco, CA) not_attending_school \n", - "\n", - " building_type commute_mode employment_status \\\n", - "293778 NaN NaN NaN \n", - "187086 single_family other_travel_mode not_in_labor_force \n", - "205818 multiple_units private_auto employed \n", - "24868 multiple_units other_travel_mode not_in_labor_force \n", - "15669 single_family private_auto employed \n", - "\n", - " work_cty_2020 individual_income \\\n", - "293778 Visitor (no work/school location) NaN \n", - "187086 Does not have work/school location 0.0 \n", - "205818 Santa Clara 20598.0 \n", - "24868 Does not have work/school location 16724.0 \n", - "15669 San Francisco 102992.0 \n", - "\n", - " home_st_2020 sex household_size \\\n", - "293778 Visitor (no home location) NaN NaN \n", - "187086 California male 5.0 \n", - "205818 California male 1.0 \n", - "24868 California female 1.0 \n", - "15669 California male 3.0 \n", + " person_id work_st_2020 household_income resident_type \\\n", + "126764 13176772315533876677 California 275131.0 core \n", + "231078 5369653974752218591 California 67771.0 core \n", + "45631 12611646703074941567 California 223094.0 core \n", + "106775 8691085808549329285 California 22658.0 core \n", + "251509 16288548793878627261 California 614473.0 core \n", + "\n", + " language available_vehicles race_ethnicity \\\n", + "126764 asian_pacific two asian_not_hispanic_or_latino \n", + "231078 spanish one hispanic_or_latino_origin \n", + "45631 english two two_races_not_hispanic_or_latino \n", + "106775 english one white_not_hispanic_or_latino \n", + "251509 spanish three_plus white_not_hispanic_or_latino \n", + "\n", + " education work_bgrp_2020 wfh \\\n", + "126764 bachelors_degree 3 (Tract 117, San Francisco, CA) in_person \n", + "231078 k_12 3 (Tract 254.01, San Francisco, CA) in_person \n", + "45631 some_college 2 (Tract 6023, San Mateo, CA) in_person \n", + "106775 advanced_degree 3 (Tract 607.01, San Francisco, CA) in_person \n", + "251509 advanced_degree 2 (Tract 105, San Francisco, CA) in_person \n", + "\n", + " home_cty_2020 home_trct_2020 tenure industry \\\n", + "126764 Alameda 4415.21 (Alameda, CA) owner naics54 \n", + "231078 Contra Costa 3072.02 (Contra Costa, CA) renter naics23 \n", + "45631 Alameda 4213 (Alameda, CA) renter naics5412 \n", + "106775 Alameda 4037.01 (Alameda, CA) renter naics54192 \n", + "251509 Contra Costa 3462.06 (Contra Costa, CA) owner naics52 \n", + "\n", + " work_trct_2020 school_grade_attending building_type \\\n", + "126764 117 (San Francisco, CA) not_attending_school single_family \n", + "231078 254.01 (San Francisco, CA) not_attending_school multiple_units \n", + "45631 6023 (San Mateo, CA) not_attending_school single_family \n", + "106775 607.01 (San Francisco, CA) graduate multiple_units \n", + "251509 105 (San Francisco, CA) not_attending_school single_family \n", + "\n", + " commute_mode employment_status work_cty_2020 individual_income \\\n", + "126764 public_transit employed San Francisco 207687.0 \n", + "231078 private_auto employed San Francisco 37165.0 \n", + "45631 private_auto employed San Mateo 153083.0 \n", + "106775 private_auto employed San Francisco 22658.0 \n", + "251509 public_transit employed San Francisco 614473.0 \n", + "\n", + " home_st_2020 sex household_size \\\n", + "126764 California male 3.0 \n", + "231078 California male 2.0 \n", + "45631 California male 3.0 \n", + "106775 California female 1.0 \n", + "251509 California male 3.0 \n", "\n", " home_bgrp_2020 household_id age \n", - "293778 Visitor (no home location) NaN \n", - "187086 1 (Tract 6004.02, San Mateo, CA) 12769569955729229579 70.0 \n", - "205818 1 (Tract 125.03, San Francisco, CA) 6412401918090088790 62.0 \n", - "24868 2 (Tract 4040, Alameda, CA) 245245365939855220 76.0 \n", - "15669 1 (Tract 4009, Alameda, CA) 11929379462304966723 32.0 " + "126764 3 (Tract 4415.21, Alameda, CA) 4405505003628472113 61.0 \n", + "231078 3 (Tract 3072.02, Contra Costa, CA) 2520287356701498339 35.0 \n", + "45631 3 (Tract 4213, Alameda, CA) 17976817071532499180 35.0 \n", + "106775 2 (Tract 4037.01, Alameda, CA) 8374180285393209524 25.0 \n", + "251509 1 (Tract 3462.06, Contra Costa, CA) 16466378101748887324 54.0 " ] }, - "execution_count": 59, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -2529,7 +3439,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 41, "id": "570daf6d-06b8-46e5-9664-a71c5a093073", "metadata": {}, "outputs": [ @@ -2579,7 +3489,7 @@ "1 visitor 23034" ] }, - "execution_count": 60, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -2590,7 +3500,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 42, "id": "2f4b67bf-78ab-4aa8-bbb0-e382a8f78c9a", "metadata": {}, "outputs": [ @@ -2772,7 +3682,7 @@ "13 worked_from_home male 18621 253921.717631 137849.973686 41.092208" ] }, - "execution_count": 61, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -2791,7 +3701,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 43, "id": "2e4bd058-9c4d-4989-a5fc-db6cf6130bf2", "metadata": {}, "outputs": [ @@ -2934,7 +3844,7 @@ "8 38.312382 " ] }, - "execution_count": 62, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -2986,7 +3896,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 44, "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", "metadata": {}, "outputs": [], @@ -2996,7 +3906,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 45, "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", "metadata": {}, "outputs": [], @@ -3006,7 +3916,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 46, "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", "metadata": {}, "outputs": [ @@ -3055,119 +3965,119 @@ " \n", " \n", " \n", - " 352\n", + " 1655\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1032819756\n", - " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", + " 1135393455\n", + " I 80 / 781148922 / 1\n", " Motorway\n", - " 0.109\n", + " 0.256\n", " yes\n", - " 220\n", + " 265\n", " WEST\n", " no\n", - " 2: Weekend Day (Sa-Su)\n", - " 22: 5pm (5pm-6pm)\n", - " 6476\n", - " 29\n", - " 14\n", - " 68.596\n", - " 707.61\n", - " 2.37\n", - " True\n", - " 55\n", + " 1: Weekday (M-F)\n", + " 05: 3am (3am-4am)\n", + " 1285\n", + " 67\n", + " 13\n", + " 67.716\n", + " 329.06\n", + " 1.01\n", + " False\n", + " 74\n", " \n", " \n", - " 434\n", + " 1064\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1036056766\n", - " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", + " 1118036302\n", + " I 80 / 839972875 / 1\n", " Motorway\n", - " 0.073\n", + " 0.006\n", " yes\n", - " 37\n", - " EAST\n", + " 265\n", + " WEST\n", " no\n", " 2: Weekend Day (Sa-Su)\n", " 14: Mid-Day (10am-4pm)\n", - " 54253\n", - " 52\n", - " 4\n", - " 67.267\n", - " 3947.53\n", - " 1.28\n", + " 38719\n", + " 50\n", + " 2\n", + " 68.762\n", + " 214.99\n", + " 1.38\n", " True\n", - " 64\n", + " 62\n", " \n", " \n", - " 831\n", + " 441\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1114495634\n", - " I 80 / 395419317 / 1\n", + " 1036056766\n", + " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", " Motorway\n", - " 0.213\n", + " 0.073\n", " yes\n", - " 82\n", + " 37\n", " EAST\n", " no\n", - " 0: All Days (M-Su)\n", + " 2: Weekend Day (Sa-Su)\n", " 21: Peak PM (4pm-8pm)\n", - " 32982\n", + " 37569\n", + " 44\n", + " 6\n", + " 67.267\n", + " 2733.58\n", + " 1.53\n", + " True\n", " 60\n", - " 13\n", - " 69.063\n", - " 7040.73\n", - " 1.15\n", - " False\n", - " 68\n", " \n", " \n", - " 1301\n", + " 215\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428...\n", + " 1022959400\n", + " San Francisco – Oakland Bay Bridge / 661905446...\n", " Motorway\n", - " 0.177\n", + " 1.939\n", " yes\n", - " 43\n", + " 40\n", " EAST\n", " no\n", " 1: Weekday (M-F)\n", - " 11: 8am (8am-9am)\n", - " 6444\n", - " 62\n", - " 10\n", - " 67.749\n", - " 1139.57\n", - " 1.09\n", + " 05: 3am (3am-4am)\n", + " 577\n", + " 63\n", + " 108\n", + " 64.627\n", + " 1118.62\n", + " 1.02\n", " False\n", - " 69\n", + " 71\n", " \n", " \n", - " 318\n", + " 902\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1032819756\n", - " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", + " 1117259749\n", + " San Francisco – Oakland Bay Bridge / 237731428...\n", " Motorway\n", - " 0.109\n", + " 1.961\n", " yes\n", - " 220\n", - " WEST\n", + " 80\n", + " EAST\n", " no\n", - " 1: Weekday (M-F)\n", - " 18: 2pm (2pm-3pm)\n", - " 7046\n", - " 57\n", - " 8\n", - " 68.596\n", - " 769.90\n", - " 1.19\n", + " 0: All Days (M-Su)\n", + " 02: Early AM (12am-6am)\n", + " 9063\n", + " 69\n", + " 102\n", + " 70.594\n", + " 17770.60\n", + " 1.02\n", " False\n", - " 68\n", + " 77\n", " \n", " \n", "\n", @@ -3175,70 +4085,70 @@ ], "text/plain": [ " data_periods \\\n", - "352 Jan 01, 2022 - Dec 31, 2022 \n", - "434 Jan 01, 2022 - Dec 31, 2022 \n", - "831 Jan 01, 2022 - Dec 31, 2022 \n", - "1301 Jan 01, 2022 - Dec 31, 2022 \n", - "318 Jan 01, 2022 - Dec 31, 2022 \n", + "1655 Jan 01, 2022 - Dec 31, 2022 \n", + "1064 Jan 01, 2022 - Dec 31, 2022 \n", + "441 Jan 01, 2022 - Dec 31, 2022 \n", + "215 Jan 01, 2022 - Dec 31, 2022 \n", + "902 Jan 01, 2022 - Dec 31, 2022 \n", "\n", " mode_of_travel zone_id \\\n", - "352 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", - "434 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", - "831 All Vehicles CVD Plus - StL All Vehicles Volume 1114495634 \n", - "1301 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", - "318 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", + "1655 All Vehicles CVD Plus - StL All Vehicles Volume 1135393455 \n", + "1064 All Vehicles CVD Plus - StL All Vehicles Volume 1118036302 \n", + "441 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", + "215 All Vehicles CVD Plus - StL All Vehicles Volume 1022959400 \n", + "902 All Vehicles CVD Plus - StL All Vehicles Volume 1117259749 \n", "\n", " zone_name road_classification \\\n", - "352 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", - "434 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", - "831 I 80 / 395419317 / 1 Motorway \n", - "1301 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", - "318 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", + "1655 I 80 / 781148922 / 1 Motorway \n", + "1064 I 80 / 839972875 / 1 Motorway \n", + "441 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", + "215 San Francisco – Oakland Bay Bridge / 661905446... Motorway \n", + "902 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", "\n", " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "352 0.109 yes 220 \n", - "434 0.073 yes 37 \n", - "831 0.213 yes 82 \n", - "1301 0.177 yes 43 \n", - "318 0.109 yes 220 \n", + "1655 0.256 yes 265 \n", + "1064 0.006 yes 265 \n", + "441 0.073 yes 37 \n", + "215 1.939 yes 40 \n", + "902 1.961 yes 80 \n", "\n", " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "352 WEST no 2: Weekend Day (Sa-Su) \n", - "434 EAST no 2: Weekend Day (Sa-Su) \n", - "831 EAST no 0: All Days (M-Su) \n", - "1301 EAST no 1: Weekday (M-F) \n", - "318 WEST no 1: Weekday (M-F) \n", - "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "352 22: 5pm (5pm-6pm) 6476 \n", - "434 14: Mid-Day (10am-4pm) 54253 \n", - "831 21: Peak PM (4pm-8pm) 32982 \n", - "1301 11: 8am (8am-9am) 6444 \n", - "318 18: 2pm (2pm-3pm) 7046 \n", + "1655 WEST no 1: Weekday (M-F) \n", + "1064 WEST no 2: Weekend Day (Sa-Su) \n", + "441 EAST no 2: Weekend Day (Sa-Su) \n", + "215 EAST no 1: Weekday (M-F) \n", + "902 EAST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "1655 05: 3am (3am-4am) 1285 \n", + "1064 14: Mid-Day (10am-4pm) 38719 \n", + "441 21: Peak PM (4pm-8pm) 37569 \n", + "215 05: 3am (3am-4am) 577 \n", + "902 02: Early AM (12am-6am) 9063 \n", "\n", " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "352 29 14 \n", - "434 52 4 \n", - "831 60 13 \n", - "1301 62 10 \n", - "318 57 8 \n", + "1655 67 13 \n", + "1064 50 2 \n", + "441 44 6 \n", + "215 63 108 \n", + "902 69 102 \n", "\n", " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "352 68.596 707.61 \n", - "434 67.267 3947.53 \n", - "831 69.063 7040.73 \n", - "1301 67.749 1139.57 \n", - "318 68.596 769.90 \n", + "1655 67.716 329.06 \n", + "1064 68.762 214.99 \n", + "441 67.267 2733.58 \n", + "215 64.627 1118.62 \n", + "902 70.594 17770.60 \n", "\n", " travel_time_index congested_segment _85th_speed_percentile \n", - "352 2.37 True 55 \n", - "434 1.28 True 64 \n", - "831 1.15 False 68 \n", - "1301 1.09 False 69 \n", - "318 1.19 False 68 " + "1655 1.01 False 74 \n", + "1064 1.38 True 62 \n", + "441 1.53 True 60 \n", + "215 1.02 False 71 \n", + "902 1.02 False 77 " ] }, - "execution_count": 65, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -3257,7 +4167,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 47, "id": "da10c3eb-31bd-437e-b546-82472d66f964", "metadata": {}, "outputs": [ @@ -3267,7 +4177,7 @@ "1710" ] }, - "execution_count": 66, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -3278,7 +4188,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 48, "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", "metadata": {}, "outputs": [ @@ -3450,7 +4360,7 @@ "18 1135393455 I 80 / 781148922 / 1 90" ] }, - "execution_count": 67, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -3461,7 +4371,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 49, "id": "cd1ce590-2019-43f0-ba09-786520479ad8", "metadata": {}, "outputs": [ @@ -3679,7 +4589,7 @@ "29 29: 11pm (11pm-12am) 3" ] }, - "execution_count": 68, + "execution_count": 49, "metadata": {}, "output_type": "execute_result" } @@ -3698,7 +4608,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 50, "id": "57c890a6-c667-4917-a090-b85f1aadcad7", "metadata": {}, "outputs": [], @@ -3708,7 +4618,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 51, "id": "0a059c82-c7c8-43b9-92a6-178b42101828", "metadata": {}, "outputs": [ @@ -3718,7 +4628,7 @@ "19" ] }, - "execution_count": 70, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -3729,7 +4639,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 52, "id": "67213733-9905-42bd-912e-cf943cd66b40", "metadata": {}, "outputs": [ @@ -3901,7 +4811,7 @@ "18 1135393455 I 80 / 781148922 / 1 1" ] }, - "execution_count": 71, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -3912,7 +4822,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 53, "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", "metadata": {}, "outputs": [ @@ -4016,7 +4926,7 @@ "1530 1.39 True 67 " ] }, - "execution_count": 72, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -4027,7 +4937,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 54, "id": "28292f62-b2ab-46cb-ac08-b728facdfdc0", "metadata": {}, "outputs": [ @@ -4076,73 +4986,73 @@ " \n", " \n", " \n", - " 1350\n", + " 1620\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1130705657\n", - " San Francisco – Oakland Bay Bridge / 52527662 / 1\n", + " 1135393455\n", + " I 80 / 781148922 / 1\n", " Motorway\n", - " 0.104\n", + " 0.256\n", " yes\n", - " 40\n", - " EAST\n", + " 265\n", + " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 129268\n", - " 51\n", - " 8\n", - " 65.986\n", - " 13419.10\n", - " 1.29\n", + " 104573\n", + " 53\n", + " 18\n", + " 67.716\n", + " 26778.50\n", + " 1.28\n", " True\n", - " 64\n", + " 67\n", " \n", " \n", - " 630\n", + " 1260\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1112052563\n", - " San Francisco – Oakland Bay Bridge / 236348360...\n", + " 1128174334\n", + " San Francisco – Oakland Bay Bridge / 237731428...\n", " Motorway\n", - " 0.054\n", + " 0.177\n", " yes\n", - " 231\n", - " WEST\n", + " 43\n", + " EAST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 128714\n", - " 52\n", - " 3\n", - " 69.248\n", - " 6900.42\n", - " 1.32\n", - " True\n", - " 69\n", + " 143645\n", + " 55\n", + " 12\n", + " 67.749\n", + " 25402.40\n", + " 1.23\n", + " False\n", + " 66\n", " \n", " \n", - " 90\n", + " 1080\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1020456908\n", - " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", + " 1120995048\n", + " San Francisco – Oakland Bay Bridge / 497579295...\n", " Motorway\n", - " 0.077\n", + " 0.056\n", " yes\n", - " 221\n", + " 222\n", " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 143382\n", + " 127886\n", " 48\n", - " 6\n", - " 68.747\n", - " 11017.90\n", - " 1.42\n", + " 4\n", + " 68.206\n", + " 7121.77\n", + " 1.41\n", " True\n", - " 68\n", + " 67\n", " \n", " \n", "\n", @@ -4150,52 +5060,52 @@ ], "text/plain": [ " data_periods \\\n", - "1350 Jan 01, 2022 - Dec 31, 2022 \n", - "630 Jan 01, 2022 - Dec 31, 2022 \n", - "90 Jan 01, 2022 - Dec 31, 2022 \n", + "1620 Jan 01, 2022 - Dec 31, 2022 \n", + "1260 Jan 01, 2022 - Dec 31, 2022 \n", + "1080 Jan 01, 2022 - Dec 31, 2022 \n", "\n", " mode_of_travel zone_id \\\n", - "1350 All Vehicles CVD Plus - StL All Vehicles Volume 1130705657 \n", - "630 All Vehicles CVD Plus - StL All Vehicles Volume 1112052563 \n", - "90 All Vehicles CVD Plus - StL All Vehicles Volume 1020456908 \n", + "1620 All Vehicles CVD Plus - StL All Vehicles Volume 1135393455 \n", + "1260 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", + "1080 All Vehicles CVD Plus - StL All Vehicles Volume 1120995048 \n", "\n", " zone_name road_classification \\\n", - "1350 San Francisco – Oakland Bay Bridge / 52527662 / 1 Motorway \n", - "630 San Francisco – Oakland Bay Bridge / 236348360... Motorway \n", - "90 San Francisco – Oakland Bay Bridge / 23874736 / 1 Motorway \n", + "1620 I 80 / 781148922 / 1 Motorway \n", + "1260 San Francisco – Oakland Bay Bridge / 237731428... Motorway \n", + "1080 San Francisco – Oakland Bay Bridge / 497579295... Motorway \n", "\n", " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "1350 0.104 yes 40 \n", - "630 0.054 yes 231 \n", - "90 0.077 yes 221 \n", + "1620 0.256 yes 265 \n", + "1260 0.177 yes 43 \n", + "1080 0.056 yes 222 \n", "\n", " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "1350 EAST no 0: All Days (M-Su) \n", - "630 WEST no 0: All Days (M-Su) \n", - "90 WEST no 0: All Days (M-Su) \n", + "1620 WEST no 0: All Days (M-Su) \n", + "1260 EAST no 0: All Days (M-Su) \n", + "1080 WEST no 0: All Days (M-Su) \n", "\n", " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "1350 00: All Day (12am-12am) 129268 \n", - "630 00: All Day (12am-12am) 128714 \n", - "90 00: All Day (12am-12am) 143382 \n", + "1620 00: All Day (12am-12am) 104573 \n", + "1260 00: All Day (12am-12am) 143645 \n", + "1080 00: All Day (12am-12am) 127886 \n", "\n", " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "1350 51 8 \n", - "630 52 3 \n", - "90 48 6 \n", + "1620 53 18 \n", + "1260 55 12 \n", + "1080 48 4 \n", "\n", " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "1350 65.986 13419.10 \n", - "630 69.248 6900.42 \n", - "90 68.747 11017.90 \n", + "1620 67.716 26778.50 \n", + "1260 67.749 25402.40 \n", + "1080 68.206 7121.77 \n", "\n", " travel_time_index congested_segment _85th_speed_percentile \n", - "1350 1.29 True 64 \n", - "630 1.32 True 69 \n", - "90 1.42 True 68 " + "1620 1.28 True 67 \n", + "1260 1.23 False 66 \n", + "1080 1.41 True 67 " ] }, - "execution_count": 73, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -4206,7 +5116,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 55, "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", "metadata": {}, "outputs": [ @@ -4275,7 +5185,7 @@ "1 50.333333 41.777778 123029.777778 1107268 " ] }, - "execution_count": 74, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -4289,7 +5199,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 56, "id": "778d58f0-25b7-4cf7-b60a-10e773055f48", "metadata": {}, "outputs": [], @@ -4331,7 +5241,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 57, "id": "29eab191-4eaa-445c-b444-49048135ef3b", "metadata": {}, "outputs": [], @@ -4353,7 +5263,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 58, "id": "896b63a9-b881-418a-ba40-dbea63f81614", "metadata": {}, "outputs": [], @@ -4367,7 +5277,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 59, "id": "cac29684-36ac-488b-b2d1-044ab5ef86c0", "metadata": {}, "outputs": [ @@ -4403,28 +5313,28 @@ " \n", " \n", " \n", - " 10\n", - " EAST\n", - " 1: Weekday (M-F)\n", + " 34\n", + " WEST\n", + " 2: Weekend Day (Sa-Su)\n", " 21: Peak PM (4pm-8pm)\n", - " 49.1\n", - " 38.3\n", - " 35673.8\n", - " 356738\n", + " 40.222222\n", + " 54.222222\n", + " 23846.222222\n", + " 214616\n", " \n", " \n", "\n", "" ], "text/plain": [ - " zone_cardinal_direction day_type day_part \\\n", - "10 EAST 1: Weekday (M-F) 21: Peak PM (4pm-8pm) \n", + " zone_cardinal_direction day_type day_part \\\n", + "34 WEST 2: Weekend Day (Sa-Su) 21: Peak PM (4pm-8pm) \n", "\n", - " avg_speed avg_travel_time avg_volume sum_volume \n", - "10 49.1 38.3 35673.8 356738 " + " avg_speed avg_travel_time avg_volume sum_volume \n", + "34 40.222222 54.222222 23846.222222 214616 " ] }, - "execution_count": 78, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -4435,7 +5345,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 60, "id": "637afffc-560f-4485-985a-d6ee73dd65a7", "metadata": {}, "outputs": [ @@ -4444,23 +5354,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 107, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "final_df = pd.DataFrame(df['transit_agency'])" + "chart = (alt.Chart(df)\n", + " .mark_circle(size=70)\n", + " .encode(\n", + " x=alt.X(\"n_modes_taken\", title=\"Number of Modes taken\"),\n", + " y=alt.Y(\"n\", title=\"Number of Trips\"),\n", + " color = alt.Color(\"agency_count\", title=\"Number of Unique Agencies\",\n", + " scale=alt.Scale(\n", + " range=cp.CALITP_DIVERGING_COLORS,\n", + " domain=df[\"agency_count\"].unique().tolist())\n", + " ),\n", + " tooltip=cols_to_keep)\n", + " .properties(title = (\"Transit Trips Agency Breakdown\"), width=500,\n", + " height=300)\n", + " )\n", + "chart " ] }, { "cell_type": "code", - "execution_count": 74, - "id": "daa329d5-ab43-4d91-9f24-529cc929118c", + "execution_count": 103, + "id": "149ed63c-436c-45fe-a526-5b1bf9f3d6fb", "metadata": {}, "outputs": [], "source": [ - "for agency in transit_agencies:\n", - " df[agency] = df['transit_agency'].str.count(agency)\n" + "# (df>>filter(_.agency_count==1)>>arrange(-_.n))" ] }, { "cell_type": "code", - "execution_count": null, - "id": "bb062bcd-4322-4970-9115-7ea91ba7041c", + "execution_count": 99, + "id": "7228c540-3033-4023-8145-91f8aee23eeb", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 77, - "id": "c19e92c8-284a-4cf7-b89a-b9c0e2cc17d9", + "execution_count": 155, + "id": "5bdc0792-219c-4877-880c-cd7d84db2303", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 155, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (alt.Chart((df>>filter(_.agency_count==1)))\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"unique_agencies\", title=\"Agency\"),\n", + " y=alt.Y(\"n\", title=\"Number of Modes taken\"),\n", + " color = alt.Color(\"n_modes_taken\", title=\"Number of Trips\",\n", + " scale=alt.Scale(\n", + " range=cp.CALITP_SEQUENTIAL_COLORS,)),\n", + " tooltip=cols_to_keep)\n", + " .properties(title = (\"Transit Trips With Only One Agency\"), width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12a9577e-cead-4e50-8f19-0cf1c73a348f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 108, + "id": "bdf5799c-4c25-4351-abce-1fd33f30e256", "metadata": {}, "outputs": [ { @@ -3575,39 +3758,159 @@ " n\n", " n_modes_taken\n", " agency_count\n", - " VTA\n", - " SamTrans\n", - " Fairfield and Suisun Transit\n", + " San Joaquin Regional Transit District (RTD)\n", " San Francisco Bay Ferry\n", - " AC TRANSIT\n", + " Tri Delta Transit\n", + " Bay Area Rapid Transit\n", + " Santa Cruz Metro\n", + " SamTrans\n", + " nan\n", " The S\n", + " Fairfield and Suisun Transit\n", + " Marin Transit\n", + " SolTrans\n", + " San Francisco Municipal Transportation Agency\n", " Caltrain\n", + " Amtrak\n", + " Sacramento Regional Transit\n", + " VTA\n", + " AC TRANSIT\n", + " unique_agencies\n", + " \n", + " \n", + " \n", + " \n", + " 123\n", + " public_transit\n", + " light_rail, light_rail, bus, bus\n", + " San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa...\n", + " 4\n", + " 4\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 3\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " AC TRANSIT, San Francisco Municipal Transportation Agency\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " primary_mode transit_submode \\\n", + "123 public_transit light_rail, light_rail, bus, bus \n", + "\n", + " transit_agency \\\n", + "123 San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa... \n", + "\n", + " n n_modes_taken agency_count \\\n", + "123 4 4 2 \n", + "\n", + " San Joaquin Regional Transit District (RTD) San Francisco Bay Ferry \\\n", + "123 0 0 \n", + "\n", + " Tri Delta Transit Bay Area Rapid Transit Santa Cruz Metro SamTrans \\\n", + "123 0 0 0 0 \n", + "\n", + " nan The S Fairfield and Suisun Transit Marin Transit SolTrans \\\n", + "123 0 0 0 0 0 \n", + "\n", + " San Francisco Municipal Transportation Agency Caltrain Amtrak \\\n", + "123 3 0 0 \n", + "\n", + " Sacramento Regional Transit VTA AC TRANSIT \\\n", + "123 0 0 1 \n", + "\n", + " unique_agencies \n", + "123 AC TRANSIT, San Francisco Municipal Transportation Agency " + ] + }, + "execution_count": 108, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sample()" + ] + }, + { + "cell_type": "code", + "execution_count": 140, + "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = df.iloc[:, 6:23]" + ] + }, + { + "cell_type": "code", + "execution_count": 141, + "id": "0dd42b8d-b8d5-4cc4-bb62-cfef6c03c7e8", + "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", @@ -3620,20 +3923,14 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3641,6 +3938,7 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", @@ -3649,17 +3947,10 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3667,6 +3958,7 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", @@ -3675,17 +3967,10 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3698,20 +3983,14 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3719,6 +3998,7 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", @@ -3744,23 +4024,10 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3772,6 +4039,7 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", @@ -3779,17 +4047,10 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -3802,28 +4063,23 @@ " \n", " \n", " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", - " \n", " \n", " \n", " \n", " \n", " \n", " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -3831,19 +4087,26 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", + " \n", + " \n", " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -3853,297 +4116,613 @@ " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", + "
San Joaquin Regional Transit District (RTD)Santa Cruz MetroSan Francisco Bay FerryTri Delta TransitBay Area Rapid TransitSacramento Regional TransitMarin TransitSanta Cruz MetroSamTransnanAmtrakThe SFairfield and Suisun TransitMarin TransitSolTransSan Francisco Municipal Transportation AgencyCaltrainAmtrakSacramento Regional TransitVTAAC TRANSIT
0public_transitbusAC TRANSIT278811000010000001
12public_transitbus, busSan Francisco Municipal Transportation Agency, AC TRANSIT63222000010000001000
8public_transitbus, busAC TRANSIT, San Francisco Municipal Transportation Agency51622000010000001000
6public_transitbus, busAC TRANSIT, AC TRANSIT26321000020000002
75public_transitbus, light_railAC TRANSIT, San Francisco Municipal Transportation Agency25322000010000001000...........................
128public_transitrail, busCaltrain, SamTrans122010000001000
130public_transitrail, bus, busAmtrak, AC TRANSIT, AC TRANSIT132000020001002
133public_transitrail, light_rail, busCaltrain, San Francisco Municipal Transportation Agency, AC TRANSIT133000010100000011000
136public_transitrail, subway, bus, busCaltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT0001440000000110001
14100000001100001
\n", + "

144 rows × 17 columns

\n", + "
" + ], + "text/plain": [ + " San Joaquin Regional Transit District (RTD) San Francisco Bay Ferry \\\n", + "0 0 0 \n", + "12 0 0 \n", + "8 0 0 \n", + "6 0 0 \n", + "75 0 0 \n", + ".. ... ... \n", + "128 0 0 \n", + "130 0 0 \n", + "133 0 0 \n", + "136 0 0 \n", + "141 0 0 \n", + "\n", + " Tri Delta Transit Bay Area Rapid Transit Santa Cruz Metro SamTrans \\\n", + "0 0 0 0 0 \n", + "12 0 0 0 0 \n", + "8 0 0 0 0 \n", + "6 0 0 0 0 \n", + "75 0 0 0 0 \n", + ".. ... ... ... ... \n", + "128 0 0 0 1 \n", + "130 0 0 0 0 \n", + "133 0 0 0 0 \n", + "136 0 1 0 0 \n", + "141 0 1 0 0 \n", + "\n", + " nan The S Fairfield and Suisun Transit Marin Transit SolTrans \\\n", + "0 0 0 0 0 0 \n", + "12 0 0 0 0 0 \n", + "8 0 0 0 0 0 \n", + "6 0 0 0 0 0 \n", + "75 0 0 0 0 0 \n", + ".. ... ... ... ... ... \n", + "128 0 0 0 0 0 \n", + "130 0 0 0 0 0 \n", + "133 0 0 0 0 0 \n", + "136 0 0 0 0 0 \n", + "141 0 0 0 0 1 \n", + "\n", + " San Francisco Municipal Transportation Agency Caltrain Amtrak \\\n", + "0 0 0 0 \n", + "12 1 0 0 \n", + "8 1 0 0 \n", + "6 0 0 0 \n", + "75 1 0 0 \n", + ".. ... ... ... \n", + "128 0 1 0 \n", + "130 0 0 1 \n", + "133 1 1 0 \n", + "136 1 1 0 \n", + "141 1 0 0 \n", + "\n", + " Sacramento Regional Transit VTA AC TRANSIT \n", + "0 0 0 1 \n", + "12 0 0 1 \n", + "8 0 0 1 \n", + "6 0 0 2 \n", + "75 0 0 1 \n", + ".. ... ... ... \n", + "128 0 0 0 \n", + "130 0 0 2 \n", + "133 0 0 1 \n", + "136 0 0 1 \n", + "141 0 0 1 \n", + "\n", + "[144 rows x 17 columns]" + ] + }, + "execution_count": 141, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 142, + "id": "814dde3a-d303-4044-9df1-464e408bf460", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" + ] + }, + { + "cell_type": "code", + "execution_count": 143, + "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_344/4109633324.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + " df_agencies['n_taken'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" + ] + } + ], + "source": [ + "df_agencies['n_taken'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 145, + "id": "f79f946b-f47d-4332-bdf7-50afbf66171f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", " \n", + " \n", + " \n", " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", + " \n", " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", " \n", + " \n", " \n", " \n", "
agency0128675143116313376139941132421297011764111114143777961011034639314045617912620308187138572781291113154318891123134135137432417482849599115121161825353946548610811012012513113214229171922232627283637384042444748495051525355565758596062656667686971738083858990929798100102103104105106107109112118119122124127128130133136141public_transitsubway, bus, bus, busBay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSITn_taken
16AC TRANSIT1112100110000112200000011101111102003110101100002011100000200121211010441110110100010111210221301011102001201010000120000221110021111100202102111111
\n", - "

144 rows × 23 columns

\n", "
" ], "text/plain": [ - " primary_mode transit_submode \\\n", - "0 public_transit bus \n", - "12 public_transit bus, bus \n", - "8 public_transit bus, bus \n", - "6 public_transit bus, bus \n", - "75 public_transit bus, light_rail \n", - ".. ... ... \n", - "128 public_transit rail, bus \n", - "130 public_transit rail, bus, bus \n", - "133 public_transit rail, light_rail, bus \n", - "136 public_transit rail, subway, bus, bus \n", - "141 public_transit subway, bus, bus, bus \n", + " agency 0 12 8 6 75 14 3 116 31 33 76 139 94 113 24 21 \\\n", + "16 AC TRANSIT 1 1 1 2 1 0 0 1 1 0 0 0 0 1 1 2 \n", + "\n", + " 29 70 117 64 111 114 143 7 77 96 101 10 34 63 93 140 45 \\\n", + "16 2 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 \n", + "\n", + " 61 79 126 20 30 81 87 138 5 72 78 129 11 13 15 43 1 88 \\\n", + "16 2 0 0 3 1 1 0 1 0 1 1 0 0 0 0 2 0 1 \n", + "\n", + " 91 123 134 135 137 4 32 41 74 82 84 95 99 115 121 16 18 \\\n", + "16 1 1 0 0 0 0 0 2 0 0 1 2 1 2 1 1 0 \n", + "\n", + " 25 35 39 46 54 86 108 110 120 125 131 132 142 2 9 17 19 \\\n", + "16 1 0 4 1 1 1 0 1 1 0 1 0 0 0 1 0 1 \n", + "\n", + " 22 23 26 27 28 36 37 38 40 42 44 47 48 49 50 51 52 53 \\\n", + "16 1 1 2 1 0 2 2 1 3 0 1 0 1 1 1 0 2 0 \n", + "\n", + " 55 56 57 58 59 60 62 65 66 67 68 69 71 73 80 83 85 89 \\\n", + "16 0 1 2 0 1 0 1 0 0 0 0 1 2 0 0 0 0 2 \n", "\n", - " transit_agency \\\n", - "0 AC TRANSIT \n", - "12 San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "8 AC TRANSIT, San Francisco Municipal Transportation Agency \n", - "6 AC TRANSIT, AC TRANSIT \n", - "75 AC TRANSIT, San Francisco Municipal Transportation Agency \n", - ".. ... \n", - "128 Caltrain, SamTrans \n", - "130 Amtrak, AC TRANSIT, AC TRANSIT \n", - "133 Caltrain, San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "136 Caltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "141 Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT \n", + " 90 92 97 98 100 102 103 104 105 106 107 109 112 118 119 \\\n", + "16 2 1 1 1 0 0 2 1 1 1 1 1 0 0 2 \n", "\n", - " n n_modes_taken agency_count VTA SamTrans \\\n", - "0 2788 1 1 0 0 \n", - "12 632 2 2 0 0 \n", - "8 516 2 2 0 0 \n", - "6 263 2 1 0 0 \n", - "75 253 2 2 0 0 \n", - ".. ... ... ... ... ... \n", - "128 1 2 2 0 1 \n", - "130 1 3 2 0 0 \n", - "133 1 3 3 0 0 \n", - "136 1 4 4 0 0 \n", - "141 1 4 4 0 0 \n", - "\n", - " Fairfield and Suisun Transit San Francisco Bay Ferry AC TRANSIT The S \\\n", - "0 0 0 1 0 \n", - "12 0 0 1 0 \n", - "8 0 0 1 0 \n", - "6 0 0 2 0 \n", - "75 0 0 1 0 \n", - ".. ... ... ... ... \n", - "128 0 0 0 0 \n", - "130 0 0 2 0 \n", - "133 0 0 1 0 \n", - "136 0 0 1 0 \n", - "141 0 0 1 0 \n", - "\n", - " Caltrain San Joaquin Regional Transit District (RTD) Santa Cruz Metro \\\n", - "0 0 0 0 \n", - "12 0 0 0 \n", - "8 0 0 0 \n", - "6 0 0 0 \n", - "75 0 0 0 \n", - ".. ... ... ... \n", - "128 1 0 0 \n", - "130 0 0 0 \n", - "133 1 0 0 \n", - "136 1 0 0 \n", - "141 0 0 0 \n", - "\n", - " Tri Delta Transit Bay Area Rapid Transit Sacramento Regional Transit \\\n", - "0 0 0 0 \n", - "12 0 0 0 \n", - "8 0 0 0 \n", - "6 0 0 0 \n", - "75 0 0 0 \n", - ".. ... ... ... \n", - "128 0 0 0 \n", - "130 0 0 0 \n", - "133 0 0 0 \n", - "136 0 1 0 \n", - "141 0 1 0 \n", - "\n", - " Marin Transit nan Amtrak SolTrans \\\n", - "0 0 0 0 0 \n", - "12 0 0 0 0 \n", - "8 0 0 0 0 \n", - "6 0 0 0 0 \n", - "75 0 0 0 0 \n", - ".. ... ... ... ... \n", - "128 0 0 0 0 \n", - "130 0 0 1 0 \n", - "133 0 0 0 0 \n", - "136 0 0 0 0 \n", - "141 0 0 0 1 \n", - "\n", - " San Francisco Municipal Transportation Agency \n", - "0 0 \n", - "12 1 \n", - "8 1 \n", - "6 0 \n", - "75 1 \n", - ".. ... \n", - "128 0 \n", - "130 0 \n", - "133 1 \n", - "136 1 \n", - "141 1 \n", - "\n", - "[144 rows x 23 columns]" + " 122 124 127 128 130 133 136 141 n_taken \n", + "16 0 2 1 0 2 1 1 1 111 " ] }, - "execution_count": 77, + "execution_count": 145, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df" + "df_agencies.sample()" ] }, { "cell_type": "code", - "execution_count": null, - "id": "4dcec868-5acc-4579-bb4c-6a9586a05553", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "97bc34c4-636f-46ca-a257-95e4af242584", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "155577dc-3f6b-4ae2-b568-e05b2b0decf0", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "eff91d88-09f7-4d36-88d4-f3076f22649f", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4744bc92-d456-4483-84f2-ce79d3501e31", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "149ed63c-436c-45fe-a526-5b1bf9f3d6fb", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5bdc0792-219c-4877-880c-cd7d84db2303", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "12a9577e-cead-4e50-8f19-0cf1c73a348f", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bdf5799c-4c25-4351-abce-1fd33f30e256", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 60, - "id": "f38660fb-344d-4695-80d1-2c621400292d", + "execution_count": 149, + "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", "metadata": {}, "outputs": [], "source": [ - "### this does not work\n", - "# ptt_agency_count = ptt_agency_count.transit_agency.str.extractall('({})'.format('|'.join(agency_list)))\\\n", - "# .iloc[:, 0].str.get_dummies().sum(level=0)" + "df_agencies = df_agencies>>select(_.agency, _.n_taken)" ] }, { "cell_type": "code", - "execution_count": 61, - "id": "a31531d3-257a-44e4-9a64-3bcdea0ccd92", + "execution_count": 150, + "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], "source": [ - "# ptt_agency_count" + "tooltip_cols = [\"agency\", \"n_taken\"]" ] }, { "cell_type": "code", - "execution_count": null, - "id": "0dd42b8d-b8d5-4cc4-bb62-cfef6c03c7e8", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "814dde3a-d303-4044-9df1-464e408bf460", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "202923d2-b869-4a72-8a02-ce229a65d815", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f79f946b-f47d-4332-bdf7-50afbf66171f", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, + "execution_count": 157, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 157, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (alt.Chart(df_agencies)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"agency\", title = \"Agency Name\"),\n", + " y=alt.Y(\"n_taken\", title= \"Number of times agency was used for trip\"),\n", + " color=alt.Color(\"n_taken\", scale=alt.Scale(range = cp.CALITP_SEQUENTIAL_COLORS)),\n", + " tooltip = tooltip_cols)\n", + " .properties(title = \"Number of Times an Agency was used for Trip taking over Bay Bridge\",\n", + " width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] }, { "cell_type": "code", @@ -4163,7 +4742,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 72, "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", "metadata": {}, "outputs": [ @@ -4186,7 +4765,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 73, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -4199,7 +4778,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 74, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -4301,7 +4880,7 @@ "8 public_transit visitor 47" ] }, - "execution_count": 32, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -4312,7 +4891,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 75, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -4321,23 +4900,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 15, + "execution_count": 123, "metadata": {}, "output_type": "execute_result" } @@ -924,9 +875,9 @@ " .encode(\n", " x=alt.X(\"primary_mode\"),\n", " y=alt.Y(\"avg_trip_time\"),\n", - " color=alt.Color(\"avg_trip_time\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS))\n", - " )\n", - " .properties(\n", + " color=alt.Color(\"avg_trip_time\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)\n", + " ), tooltip=trips.columns.tolist())\n", + " .properties(title = \"Average Trip Time\",\n", " width=800,\n", " height=300)\n", " )\n", @@ -935,30 +886,7 @@ }, { "cell_type": "code", - "execution_count": 16, - "id": "6ce33204-b2f7-4d86-906a-f0bfd8c3330c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "

Number of Trips

" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "display(HTML(\"

Number of Trips

\"))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 17, + "execution_count": 124, "id": "65681a29-7f1b-42ed-9e0e-371a84a29cbd", "metadata": {}, "outputs": [ @@ -967,23 +895,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 17, + "execution_count": 124, "metadata": {}, "output_type": "execute_result" } @@ -1048,9 +976,9 @@ " .encode(\n", " x=alt.X(\"primary_mode\"),\n", " y=alt.Y(\"number_trips\"),\n", - " color=alt.Color(\"number_trips\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,))\n", - " )\n", - " .properties(\n", + " color=alt.Color(\"number_trips\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,)\n", + " ), tooltip=trips.columns.tolist())\n", + " .properties(title=\"Number of Trips\",\n", " width=800,\n", " height=300)\n", " )\n", @@ -1297,23 +1225,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" + ], "text/plain": [ - "3 61\n", - "4 34\n", - "2 28\n", - "1 11\n", - "5 9\n", - "6 1\n", - "Name: n_modes_taken, dtype: int64" + "alt.Chart(...)" ] }, - "execution_count": 42, + "execution_count": 187, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "ptt_agency_count.n_modes_taken.value_counts()" + "chart = (\n", + " alt.Chart((modes_count))\n", + " .mark_bar(size=60)\n", + " .encode(\n", + " x=alt.X(\"n_modes_taken\", title =\"Number of Modes Taken per Trip\"),\n", + " y=alt.Y(\"n_trips\", title = \"Number of Trips\"),\n", + " color=alt.Color(\"n_trips\", title = \"Number of Trips\",\n", + " scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)),\n", + " tooltip=modes_count.columns.tolist())\n", + " \n", + " .properties(title = \"How Many Modes are Taken Per Trip\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 193, + "id": "fb8565b9-989a-459a-bede-433de30252e7", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count>>group_by(_.agency_count)>>count(_.n_modes_taken)>>arrange(-_.n)\n", + "agency_mode_trips = ptt_agency_count>>group_by(_.agency_count, _.n_modes_taken)>>summarize(ntrips=_.n.sum())>>arrange(-_.ntrips)" ] }, { "cell_type": "code", - "execution_count": 43, - "id": "e272bb04-b635-48ef-ba6e-b946abc3aca6", + "execution_count": 216, + "id": "b03dbe0a-a759-4fa9-849b-b31b318f86cd", "metadata": {}, "outputs": [ { "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], "text/plain": [ - "2 66\n", - "3 41\n", - "1 28\n", - "4 8\n", - "5 1\n", - "Name: agency_count, dtype: int64" + "alt.Chart(...)" ] }, - "execution_count": 43, + "execution_count": 216, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "ptt_agency_count.agency_count.value_counts()" + "chart = (\n", + " alt.Chart((agency_mode_trips))\n", + " .mark_circle(size=100)\n", + " .encode(\n", + " x=alt.X(\"agency_count\", title =\"Number of Agencies\"),\n", + " y=alt.Y(\"n_modes_taken\", title = \"Number of Modes Taken\"),\n", + " color=alt.Color(\"ntrips\", title = \"Number of Trips\",\n", + " scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)),\n", + " tooltip=agency_mode_trips.columns.tolist())\n", + " \n", + " .properties(title = \"How Many Modes are Taken Per Trip\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " ] }, { "cell_type": "code", - "execution_count": 44, - "id": "fb8565b9-989a-459a-bede-433de30252e7", - "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", - "
agency_countn_modes_takenn
52329
83325
42223
93413
62412
01111
2137
1125
3145
12444
13454
7252
10352
11361
14551
\n", - "
" - ], - "text/plain": [ - " agency_count n_modes_taken n\n", - "5 2 3 29\n", - "8 3 3 25\n", - "4 2 2 23\n", - "9 3 4 13\n", - "6 2 4 12\n", - "0 1 1 11\n", - "2 1 3 7\n", - "1 1 2 5\n", - "3 1 4 5\n", - "12 4 4 4\n", - "13 4 5 4\n", - "7 2 5 2\n", - "10 3 5 2\n", - "11 3 6 1\n", - "14 5 5 1" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ptt_agency_count>>group_by(_.agency_count)>>count(_.n_modes_taken)>>arrange(-_.n)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "91273d26-1fd1-42a1-b829-a77398c606fc", + "execution_count": null, + "id": "91273d26-1fd1-42a1-b829-a77398c606fc", "metadata": {}, "outputs": [], "source": [] @@ -2471,142 +2308,20 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 127, "id": "e8f5f457-ce9f-4bfb-99f6-82e6eb7d11f0", "metadata": { "scrolled": true, "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "['AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency',\n", - " 'AC TRANSIT, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'AC TRANSIT, AC TRANSIT, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, AC TRANSIT, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit',\n", - " 'nan',\n", - " 'AC TRANSIT, SamTrans',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'SamTrans, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT',\n", - " 'AC TRANSIT, Bay Area Rapid Transit',\n", - " 'Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'Caltrain',\n", - " 'AC TRANSIT, AC TRANSIT, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, SamTrans, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'VTA, Caltrain',\n", - " 'Bay Area Rapid Transit, AC TRANSIT',\n", - " 'VTA',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, AC TRANSIT',\n", - " 'Caltrain, VTA',\n", - " 'SamTrans, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, SamTrans',\n", - " 'San Francisco Municipal Transportation Agency, SolTrans',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, AC TRANSIT, AC TRANSIT',\n", - " 'Marin Transit',\n", - " 'The S, Amtrak, AC TRANSIT',\n", - " 'AC TRANSIT, Amtrak, Sacramento Regional Transit',\n", - " 'Caltrain, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'Caltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'Bay Area Rapid Transit',\n", - " 'SolTrans',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, SamTrans',\n", - " 'AC TRANSIT, AC TRANSIT, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, Caltrain',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, AC TRANSIT',\n", - " 'SolTrans, AC TRANSIT',\n", - " 'SolTrans, SolTrans',\n", - " 'AC TRANSIT, SolTrans, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, SolTrans, SolTrans',\n", - " 'AC TRANSIT, AC TRANSIT, AC TRANSIT, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Caltrain',\n", - " 'AC TRANSIT, Amtrak',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, Caltrain',\n", - " 'San Francisco Bay Ferry, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'Caltrain, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'Bay Area Rapid Transit, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'SamTrans',\n", - " 'AC TRANSIT, SolTrans',\n", - " 'SolTrans, San Francisco Municipal Transportation Agency',\n", - " 'VTA, AC TRANSIT',\n", - " 'AC TRANSIT, SamTrans, San Francisco Municipal Transportation Agency',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, SamTrans',\n", - " 'SamTrans, AC TRANSIT, AC TRANSIT',\n", - " 'SamTrans, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'SamTrans, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'SolTrans, AC TRANSIT, AC TRANSIT',\n", - " 'VTA, AC TRANSIT, AC TRANSIT',\n", - " 'VTA, VTA, AC TRANSIT',\n", - " 'AC TRANSIT, AC TRANSIT, AC TRANSIT, San Francisco Municipal Transportation Agency',\n", - " 'SamTrans, SolTrans, SolTrans, SolTrans',\n", - " 'SolTrans, SolTrans, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, AC TRANSIT, SolTrans, SolTrans, Sacramento Regional Transit',\n", - " 'VTA, SamTrans, AC TRANSIT, SolTrans, Fairfield and Suisun Transit',\n", - " 'AC TRANSIT, SolTrans, SolTrans, Sacramento Regional Transit, Sacramento Regional Transit',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Caltrain',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Caltrain',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Caltrain, SamTrans',\n", - " 'San Joaquin Regional Transit District (RTD), San Joaquin Regional Transit District (RTD), San Joaquin Regional Transit District (RTD), Amtrak, AC TRANSIT, AC TRANSIT',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, San Francisco Bay Ferry',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Bay Ferry, SolTrans',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, Caltrain',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Caltrain',\n", - " 'VTA, VTA, Caltrain',\n", - " 'AC TRANSIT, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, VTA',\n", - " 'Santa Cruz Metro, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, SolTrans',\n", - " 'The S, Amtrak, AC TRANSIT, AC TRANSIT',\n", - " 'The S, Amtrak, AC TRANSIT, AC TRANSIT, San Francisco Municipal Transportation Agency',\n", - " 'AC TRANSIT, Amtrak, Sacramento Regional Transit, Sacramento Regional Transit',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, VTA',\n", - " 'SamTrans, Bay Area Rapid Transit, AC TRANSIT',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, SamTrans',\n", - " 'VTA, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'Tri Delta Transit, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'VTA, Bay Area Rapid Transit, AC TRANSIT, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, Amtrak',\n", - " 'AC TRANSIT, Bay Area Rapid Transit, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, SolTrans',\n", - " 'San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, AC TRANSIT, AC TRANSIT',\n", - " 'Amtrak, AC TRANSIT',\n", - " 'Caltrain, SamTrans',\n", - " 'Amtrak, AC TRANSIT, AC TRANSIT',\n", - " 'Caltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT',\n", - " 'Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT']" - ] - }, - "execution_count": 46, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "ptt_agency_count['transit_agency'].unique().tolist()" + "# ptt_agency_count['transit_agency'].unique().tolist()" ] }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 198, "id": "4b48b976-e4c7-4b8f-81d0-f3a54ed33a5e", "metadata": {}, "outputs": [], @@ -2631,7 +2346,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 199, "id": "f430e943-c918-4449-8e62-e0d33ba82aff", "metadata": {}, "outputs": [], @@ -2641,7 +2356,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 200, "id": "740afd55-23fe-403a-bfe5-037aa6802c0c", "metadata": {}, "outputs": [], @@ -2651,31 +2366,20 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 201, "id": "09ee5ac0-1bf2-40d4-8d29-7397d9b84d9e", "metadata": { "scrolled": true, "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "\"['Ac Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Nan', 'Ac Transit', 'Samtrans', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Bay Area Rapid Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Vta', 'Caltrain', 'Bay Area Rapid Transit', 'Ac Transit', 'Vta', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Caltrain', 'Vta', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'Marin Transit', 'The S', 'Amtrak', 'Ac Transit', 'Ac Transit', 'Amtrak', 'Sacramento Regional Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Caltrain', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Caltrain', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Ac Transit', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Soltrans', 'Ac Transit', 'Soltrans', 'Soltrans', 'Ac Transit', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Soltrans', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Ac Transit', 'Amtrak', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Caltrain', 'San Francisco Bay Ferry', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Caltrain', 'Vta', 'Bay Area Rapid Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Ac Transit', 'Soltrans', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'Vta', 'Ac Transit', 'Ac Transit', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Samtrans', 'Ac Transit', 'Ac Transit', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit', 'Ac Transit', 'Vta', 'Ac Transit', 'Ac Transit', 'Vta', 'Vta', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Samtrans', 'Soltrans', 'Soltrans', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Soltrans', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Soltrans', 'Soltrans', 'Sacramento Regional Transit', 'Vta', 'Samtrans', 'Ac Transit', 'Soltrans', 'Fairfield And Suisun Transit', 'Ac Transit', 'Soltrans', 'Soltrans', 'Sacramento Regional Transit', 'Sacramento Regional Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Samtrans', 'San Joaquin Regional Transit District (Rtd)', 'San Joaquin Regional Transit District (Rtd)', 'San Joaquin Regional Transit District (Rtd)', 'Amtrak', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Bay Ferry', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Bay Ferry', 'Soltrans', 'Ac Transit', 'Samtrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Caltrain', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Caltrain', 'Vta', 'Vta', 'Caltrain', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Vta', 'Santa Cruz Metro', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Caltrain', 'The S', 'Amtrak', 'Ac Transit', 'Ac Transit', 'The S', 'Amtrak', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Amtrak', 'Sacramento Regional Transit', 'Sacramento Regional Transit', 'Ac Transit', 'Bay Area Rapid Transit', 'Vta', 'Samtrans', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'Samtrans', 'Vta', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Tri Delta Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Vta', 'Bay Area Rapid Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit', 'Ac Transit', 'Bay Area Rapid Transit', 'Amtrak', 'Ac Transit', 'Bay Area Rapid Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Vta', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Ac Transit', 'Amtrak', 'Ac Transit', 'Caltrain', 'Samtrans', 'Amtrak', 'Ac Transit', 'Ac Transit', 'Caltrain', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Caltrain', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Ac Transit', 'Bay Area Rapid Transit', 'San Francisco Municipal Transportation Agency', 'Soltrans', 'Ac Transit']\"" - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "text_list" + "# text_list" ] }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 202, "id": "3c399936-bc62-491c-b71d-89a861e02fc7", "metadata": {}, "outputs": [], @@ -2685,7 +2389,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 203, "id": "5ae1e7f0-9e1c-4795-a3cc-d16f98e039d2", "metadata": {}, "outputs": [], @@ -2695,7 +2399,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 204, "id": "cc080910-1ad8-4303-a825-eb4370f78f5c", "metadata": {}, "outputs": [], @@ -2705,31 +2409,32 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 205, "id": "416d16f0-3128-4857-9136-69f0403ce5cc", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "17" - ] - }, - "execution_count": 54, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "len(agency_list)" + "# len(agency_list)" ] }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 206, "id": "f303acae-da1b-44a5-98b2-2f8f5b98f56a", "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + "

Agencies Identified in Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "text/plain": [ @@ -2752,13 +2457,15 @@ " 'Vta'}" ] }, - "execution_count": 55, + "execution_count": 206, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "agency_list" + "display(HTML(\"

Agencies Identified in Trips Data

\")) \n", + "\n", + "(agency_list)" ] }, { @@ -2815,72 +2522,6 @@ "# ptt_agency_count['transit_agency'] = ptt_agency_count['transit_agency'].str.strip('()').str.split(',')" ] }, - { - "cell_type": "code", - "execution_count": 59, - "id": "ab24cd2f-bdba-4105-950c-f0987af73714", - "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", - "
primary_modetransit_submodetransit_agencynn_modes_takenagency_count
10public_transitbus, busSamTrans, AC TRANSIT1622
\n", - "
" - ], - "text/plain": [ - " primary_mode transit_submode transit_agency n n_modes_taken \\\n", - "10 public_transit bus, bus SamTrans, AC TRANSIT 16 2 \n", - "\n", - " agency_count \n", - "10 2 " - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ptt_agency_count.sample()" - ] - }, { "cell_type": "code", "execution_count": 60, @@ -2922,200 +2563,8 @@ }, { "cell_type": "code", - "execution_count": 63, - "id": "0c0030d9-1456-412a-bdb8-d0d391952dc1", - "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", - "
primary_modetransit_submodetransit_agencynn_modes_takenagency_count
0public_transitbusAC TRANSIT278811
12public_transitbus, busSan Francisco Municipal Transportation Agency, AC TRANSIT63222
8public_transitbus, busAC TRANSIT, San Francisco Municipal Transportation Agency51622
6public_transitbus, busAC TRANSIT, AC TRANSIT26321
75public_transitbus, light_railAC TRANSIT, San Francisco Municipal Transportation Agency25322
.....................
128public_transitrail, busCaltrain, SamTrans122
130public_transitrail, bus, busAmtrak, AC TRANSIT, AC TRANSIT132
133public_transitrail, light_rail, busCaltrain, San Francisco Municipal Transportation Agency, AC TRANSIT133
136public_transitrail, subway, bus, busCaltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT144
141public_transitsubway, bus, bus, busBay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT144
\n", - "

144 rows × 6 columns

\n", - "
" - ], - "text/plain": [ - " primary_mode transit_submode \\\n", - "0 public_transit bus \n", - "12 public_transit bus, bus \n", - "8 public_transit bus, bus \n", - "6 public_transit bus, bus \n", - "75 public_transit bus, light_rail \n", - ".. ... ... \n", - "128 public_transit rail, bus \n", - "130 public_transit rail, bus, bus \n", - "133 public_transit rail, light_rail, bus \n", - "136 public_transit rail, subway, bus, bus \n", - "141 public_transit subway, bus, bus, bus \n", - "\n", - " transit_agency \\\n", - "0 AC TRANSIT \n", - "12 San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "8 AC TRANSIT, San Francisco Municipal Transportation Agency \n", - "6 AC TRANSIT, AC TRANSIT \n", - "75 AC TRANSIT, San Francisco Municipal Transportation Agency \n", - ".. ... \n", - "128 Caltrain, SamTrans \n", - "130 Amtrak, AC TRANSIT, AC TRANSIT \n", - "133 Caltrain, San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "136 Caltrain, Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "141 Bay Area Rapid Transit, San Francisco Municipal Transportation Agency, SolTrans, AC TRANSIT \n", - "\n", - " n n_modes_taken agency_count \n", - "0 2788 1 1 \n", - "12 632 2 2 \n", - "8 516 2 2 \n", - "6 263 2 1 \n", - "75 253 2 2 \n", - ".. ... ... ... \n", - "128 1 2 2 \n", - "130 1 3 2 \n", - "133 1 3 3 \n", - "136 1 4 4 \n", - "141 1 4 4 \n", - "\n", - "[144 rows x 6 columns]" - ] - }, - "execution_count": 63, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df" - ] - }, - { - "cell_type": "code", - "execution_count": 64, - "id": "1ed407a8-9c32-41ba-8ad8-15e422d14c0a", + "execution_count": 64, + "id": "1ed407a8-9c32-41ba-8ad8-15e422d14c0a", "metadata": {}, "outputs": [], "source": [ @@ -3132,6 +2581,14 @@ "# df2" ] }, + { + "cell_type": "code", + "execution_count": 268, + "id": "5bdc0792-219c-4877-880c-cd7d84db2303", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, @@ -3150,56 +2607,133 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 274, + "id": "bd6f46a5-404f-41eb-9fd8-4600451e6d20", + "metadata": {}, + "outputs": [], + "source": [ + "agency_indv_count = (r_trips>>filter(_.primary_mode==\"public_transit\")>>select(_.transit_agency))\n", + "agency_indv_count['transit_agency'] = agency_indv_count['transit_agency'].astype(str)" + ] + }, + { + "cell_type": "code", + "execution_count": 278, "id": "6c664504-dad9-47f8-929a-dbb8810af191", "metadata": {}, "outputs": [], "source": [ - "transit_agencies = set()\n", - "for agencies in df['transit_agency'].str.split(', '):\n", - " transit_agencies.update(agencies)" + "# transit_agencies = set()\n", + "# for agencies in df['transit_agency'].str.split(', '):\n", + "# transit_agencies.update(agencies)" ] }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 279, "id": "f577e93c-5cf9-4a2b-95b7-a6cd8577c4d8", "metadata": {}, "outputs": [], "source": [ - "unique_agencies = []\n" + "# unique_agencies = []" ] }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 280, "id": "daa329d5-ab43-4d91-9f24-529cc929118c", "metadata": {}, "outputs": [], "source": [ - "for agency in transit_agencies:\n", - " df[agency] = df['transit_agency'].str.count(agency)\n", - " unique_agencies.append(agency)" + "# for agency in transit_agencies:\n", + "# df[agency] = df['transit_agency'].str.count(agency)\n", + "# unique_agencies.append(agency)" ] }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 281, "id": "bb062bcd-4322-4970-9115-7ea91ba7041c", "metadata": {}, "outputs": [], "source": [ - "### adding column for unique agencies list\n", - "def get_unique_agencies(agency_list):\n", - " unique_agencies = set()\n", - " for agencies in agency_list:\n", - " unique_agencies.update(agencies.split(', '))\n", - " return ', '.join(sorted(list(unique_agencies)))\n", + "# ### adding column for unique agencies list\n", + "# def get_unique_agencies(agency_list):\n", + "# unique_agencies = set()\n", + "# for agencies in agency_list:\n", + "# unique_agencies.update(agencies.split(', '))\n", + "# return ', '.join(sorted(list(unique_agencies)))\n", + "\n", + "# # Applying the function to each row of the dataframe to get unique agencies\n", + "# df['unique_agencies'] = df['transit_agency'].str.split(', ').apply(lambda x: get_unique_agencies(x))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6a011752-5211-40b4-a108-a8036fdbacce", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 286, + "id": "045be8fb-d8fd-4019-8282-df53602b122b", + "metadata": {}, + "outputs": [], + "source": [ + "def get_dummies_by_agency(df, col):\n", + " transit_agencies = set()\n", + " for agencies in df[col].str.split(', '):\n", + " transit_agencies.update(agencies)\n", + " unique_agencies = []\n", + " \n", + " for agency in transit_agencies:\n", + " df[agency] = df[col].str.count(agency)\n", + " unique_agencies.append(agency)\n", "\n", - "# Applying the function to each row of the dataframe to get unique agencies\n", - "df['unique_agencies'] = df['transit_agency'].str.split(', ').apply(lambda x: get_unique_agencies(x))" + " ### adding column for unique agencies list\n", + " def get_unique_agencies(agency_list):\n", + " unique_agencies = set()\n", + " for agencies in agency_list:\n", + " unique_agencies.update(agencies.split(', '))\n", + " return ', '.join(sorted(list(unique_agencies)))\n", + "\n", + " # Applying the function to each row of the dataframe to get unique agencies\n", + " df['unique_agencies'] = df[col].str.split(', ').apply(lambda x: get_unique_agencies(x))\n", + " \n", + " return df" + ] + }, + { + "cell_type": "code", + "execution_count": 283, + "id": "efc4eb07-c0f9-4bc2-87bb-cac95f606657", + "metadata": {}, + "outputs": [], + "source": [ + "df = get_dummies_by_agency(df, \"transit_agency\")" + ] + }, + { + "cell_type": "code", + "execution_count": 284, + "id": "cefbf215-185b-423d-b154-731fb0fa6a39", + "metadata": {}, + "outputs": [], + "source": [ + "agency_indv_count = get_dummies_by_agency(agency_indv_count, \"transit_agency\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "cbc9e090-d0d0-4632-9de7-4f225c61b6a4", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, @@ -3210,525 +2744,416 @@ }, { "cell_type": "code", - "execution_count": 70, - "id": "c19e92c8-284a-4cf7-b89a-b9c0e2cc17d9", + "execution_count": 285, + "id": "97bc34c4-636f-46ca-a257-95e4af242584", + "metadata": {}, + "outputs": [], + "source": [ + "##### Identifying trips with one agency" + ] + }, + { + "cell_type": "code", + "execution_count": 218, + "id": "46856b31-47ac-408c-903e-19d8b04283f7", + "metadata": {}, + "outputs": [], + "source": [ + "# cols_to_keep = [\"transit_submode\",\"unique_agencies\", \"n\",\"n_modes_taken\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 217, + "id": "2603e7e0-389a-49fb-93e9-5dc1d52c6012", + "metadata": {}, + "outputs": [], + "source": [ + "# chart = (alt.Chart(df)\n", + "# .mark_circle(size=100)\n", + "# .encode(\n", + "# x=alt.X(\"n_modes_taken\", title=\"Number of Modes taken\"),\n", + "# y=alt.Y(\"n\", title=\"Number of Trips\"),\n", + "# color = alt.Color(\"agency_count\", title=\"Number of Unique Agencies\",\n", + "# scale=alt.Scale(\n", + "# range=cp.CALITP_DIVERGING_COLORS,\n", + "# domain=df[\"agency_count\"].unique().tolist())\n", + "# ),\n", + "# tooltip=cols_to_keep)\n", + "# .properties(title = (\"Transit Trips Agency Breakdown\"), width=500,\n", + "# height=300)\n", + "# )\n", + "# chart " + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "id": "149ed63c-436c-45fe-a526-5b1bf9f3d6fb", + "metadata": {}, + "outputs": [], + "source": [ + "# (df>>filter(_.agency_count==1)>>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 287, + "id": "7228c540-3033-4023-8145-91f8aee23eeb", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", - "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 287, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (alt.Chart((df>>filter(_.agency_count==1)))\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"unique_agencies\", title=\"Agency\"),\n", + " y=alt.Y(\"n\", title=\"Number of Modes taken\"),\n", + " color = alt.Color(\"n_modes_taken\", title=\"Number of Trips\",\n", + " scale=alt.Scale(\n", + " range=cp.CALITP_SEQUENTIAL_COLORS,)),\n", + " tooltip=cols_to_keep)\n", + " .properties(title = (\"Transit Trips With Only One Agency\"), width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 288, + "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Most Common Agency Combination

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "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", "
transit_agency
108public_transitbus, subway, railSan Francisco Municipal Transportation Agency, Bay Area Rapid Transit, Caltrain23300010000000110000Bay Area Rapid Transit, Caltrain, San Francisco Municipal Transportation Agency0AC TRANSIT
137public_transitsubwayBay Area Rapid Transit41100010000000000000Bay Area Rapid Transit12San Francisco Municipal Transportation Agency, AC TRANSIT
64public_transitbus, bus, light_railSan Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa...273100000000000300000San Francisco Municipal Transportation Agency8AC TRANSIT, San Francisco Municipal Transportation Agency
62public_transitbus, bus, light_railAC TRANSIT, SamTrans, San Francisco Municipal Transportation Agency13300000100000100001AC TRANSIT, SamTrans, San Francisco Municipal Transportation Agency6AC TRANSIT, AC TRANSIT
131public_transitrail, bus, busCaltrain, San Francisco Municipal Transportation Agency, AC TRANSIT23300000000000110001AC TRANSIT, Caltrain, San Francisco Municipal Transportation Agency75AC TRANSIT, San Francisco Municipal Transportation Agency
\n", "
" ], "text/plain": [ - " primary_mode transit_submode \\\n", - "108 public_transit bus, subway, rail \n", - "137 public_transit subway \n", - "64 public_transit bus, bus, light_rail \n", - "62 public_transit bus, bus, light_rail \n", - "131 public_transit rail, bus, bus \n", - "\n", - " transit_agency \\\n", - "108 San Francisco Municipal Transportation Agency, Bay Area Rapid Transit, Caltrain \n", - "137 Bay Area Rapid Transit \n", - "64 San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa... \n", - "62 AC TRANSIT, SamTrans, San Francisco Municipal Transportation Agency \n", - "131 Caltrain, San Francisco Municipal Transportation Agency, AC TRANSIT \n", - "\n", - " n n_modes_taken agency_count \\\n", - "108 2 3 3 \n", - "137 4 1 1 \n", - "64 27 3 1 \n", - "62 1 3 3 \n", - "131 2 3 3 \n", - "\n", - " San Joaquin Regional Transit District (RTD) San Francisco Bay Ferry \\\n", - "108 0 0 \n", - "137 0 0 \n", - "64 0 0 \n", - "62 0 0 \n", - "131 0 0 \n", - "\n", - " Tri Delta Transit Bay Area Rapid Transit Santa Cruz Metro SamTrans \\\n", - "108 0 1 0 0 \n", - "137 0 1 0 0 \n", - "64 0 0 0 0 \n", - "62 0 0 0 1 \n", - "131 0 0 0 0 \n", - "\n", - " nan The S Fairfield and Suisun Transit Marin Transit SolTrans \\\n", - "108 0 0 0 0 0 \n", - "137 0 0 0 0 0 \n", - "64 0 0 0 0 0 \n", - "62 0 0 0 0 0 \n", - "131 0 0 0 0 0 \n", - "\n", - " San Francisco Municipal Transportation Agency Caltrain Amtrak \\\n", - "108 1 1 0 \n", - "137 0 0 0 \n", - "64 3 0 0 \n", - "62 1 0 0 \n", - "131 1 1 0 \n", - "\n", - " Sacramento Regional Transit VTA AC TRANSIT \\\n", - "108 0 0 0 \n", - "137 0 0 0 \n", - "64 0 0 0 \n", - "62 0 0 1 \n", - "131 0 0 1 \n", - "\n", - " unique_agencies \n", - "108 Bay Area Rapid Transit, Caltrain, San Francisco Municipal Transportation Agency \n", - "137 Bay Area Rapid Transit \n", - "64 San Francisco Municipal Transportation Agency \n", - "62 AC TRANSIT, SamTrans, San Francisco Municipal Transportation Agency \n", - "131 AC TRANSIT, Caltrain, San Francisco Municipal Transportation Agency " + " transit_agency\n", + "0 AC TRANSIT\n", + "12 San Francisco Municipal Transportation Agency, AC TRANSIT\n", + "8 AC TRANSIT, San Francisco Municipal Transportation Agency\n", + "6 AC TRANSIT, AC TRANSIT\n", + "75 AC TRANSIT, San Francisco Municipal Transportation Agency" ] }, - "execution_count": 70, + "execution_count": 288, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df.sample(5)" + "display(HTML(\"

Most Common Agency Combination

\")) \n", + "\n", + "(df>>arrange(-_.n)>>select(_.transit_agency)).head(5)" ] }, { "cell_type": "code", - "execution_count": 71, - "id": "97bc34c4-636f-46ca-a257-95e4af242584", + "execution_count": null, + "id": "786394ef-be26-4e0d-94e7-35386d6d67c0", "metadata": {}, "outputs": [], - "source": [ - "##### Identifying trips with one agency" - ] + "source": [] }, { "cell_type": "code", "execution_count": null, - "id": "46856b31-47ac-408c-903e-19d8b04283f7", + "id": "fd43ab95-0391-407b-b6b0-185034ba9528", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 289, + "id": "8af03d60-4537-44d3-b82f-d857625e47c3", "metadata": {}, "outputs": [], "source": [ - "cols_to_keep = [\"transit_submode\",\"unique_agencies\", \"n\",\"n_modes_taken\"]" + "columns_to_keep = [\"AC TRANSIT\",\n", + " \"San Francisco Bay Ferry\",\n", + " \"SolTrans\",\n", + " \"Caltrain\",\n", + " \"SamTrans\",\n", + " \"The S\",\n", + " \"Fairfield and Suisun Transit\",\n", + " \"Sacramento Regional Transit\",\n", + " \"Marin Transit\",\n", + " \"Tri Delta Transit\",\n", + " \"San Francisco Municipal Transportation Agency\",\n", + " \"Amtrak\",\n", + " \"San Joaquin Regional Transit District (RTD)\",\n", + " \"Bay Area Rapid Transit\",\n", + " \"Santa Cruz Metro\",\n", + " \"VTA\"\n", + " ]" ] }, { "cell_type": "code", - "execution_count": 107, - "id": "2603e7e0-389a-49fb-93e9-5dc1d52c6012", + "execution_count": 291, + "id": "6951b590-cef8-44bd-b27d-0b18893609c5", "metadata": {}, "outputs": [ { "data": { "text/html": [ + "
\n", + "\n", - "
\n", - "" - ], - "text/plain": [ - "alt.Chart(...)" + " San Joaquin Regional Transit District (RTD) \\\n", + "180902 0 \n", + "\n", + " San Francisco Municipal Transportation Agency Santa Cruz Metro \\\n", + "180902 0 0 \n", + "\n", + " Bay Area Rapid Transit VTA unique_agencies \n", + "180902 0 0 AC TRANSIT " ] }, - "execution_count": 107, + "execution_count": 291, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "chart = (alt.Chart(df)\n", - " .mark_circle(size=70)\n", - " .encode(\n", - " x=alt.X(\"n_modes_taken\", title=\"Number of Modes taken\"),\n", - " y=alt.Y(\"n\", title=\"Number of Trips\"),\n", - " color = alt.Color(\"agency_count\", title=\"Number of Unique Agencies\",\n", - " scale=alt.Scale(\n", - " range=cp.CALITP_DIVERGING_COLORS,\n", - " domain=df[\"agency_count\"].unique().tolist())\n", - " ),\n", - " tooltip=cols_to_keep)\n", - " .properties(title = (\"Transit Trips Agency Breakdown\"), width=500,\n", - " height=300)\n", - " )\n", - "chart " + "agency_indv_count.sample()" ] }, { "cell_type": "code", - "execution_count": 103, - "id": "149ed63c-436c-45fe-a526-5b1bf9f3d6fb", + "execution_count": 292, + "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", "metadata": {}, "outputs": [], "source": [ - "# (df>>filter(_.agency_count==1)>>arrange(-_.n))" + "df_agencies = agency_indv_count.loc[:, columns_to_keep]" ] }, { "cell_type": "code", - "execution_count": 99, - "id": "7228c540-3033-4023-8145-91f8aee23eeb", + "execution_count": 293, + "id": "814dde3a-d303-4044-9df1-464e408bf460", "metadata": {}, "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 155, - "id": "5bdc0792-219c-4877-880c-cd7d84db2303", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "
\n", - "" - ], - "text/plain": [ - "alt.Chart(...)" - ] - }, - "execution_count": 155, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "chart = (alt.Chart((df>>filter(_.agency_count==1)))\n", - " .mark_bar()\n", - " .encode(\n", - " x=alt.X(\"unique_agencies\", title=\"Agency\"),\n", - " y=alt.Y(\"n\", title=\"Number of Modes taken\"),\n", - " color = alt.Color(\"n_modes_taken\", title=\"Number of Trips\",\n", - " scale=alt.Scale(\n", - " range=cp.CALITP_SEQUENTIAL_COLORS,)),\n", - " tooltip=cols_to_keep)\n", - " .properties(title = (\"Transit Trips With Only One Agency\"), width=800,\n", - " height=500)\n", - " )\n", - "chart " + "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" ] }, { "cell_type": "code", - "execution_count": null, - "id": "12a9577e-cead-4e50-8f19-0cf1c73a348f", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 108, - "id": "bdf5799c-4c25-4351-abce-1fd33f30e256", + "execution_count": 294, + "id": "84174911-2243-430c-ab73-1fecb2552094", "metadata": {}, "outputs": [ { @@ -3752,41 +3177,8230 @@ " \n", " \n", " \n", - " primary_mode\n", - " transit_submode\n", - " transit_agency\n", - " n\n", - " n_modes_taken\n", - " agency_count\n", - " San Joaquin Regional Transit District (RTD)\n", - " San Francisco Bay Ferry\n", - " Tri Delta Transit\n", - " Bay Area Rapid Transit\n", - " Santa Cruz Metro\n", - " SamTrans\n", - " nan\n", - " The S\n", - " Fairfield and Suisun Transit\n", - " Marin Transit\n", - " SolTrans\n", - " San Francisco Municipal Transportation Agency\n", - " Caltrain\n", - " Amtrak\n", - " Sacramento Regional Transit\n", - " VTA\n", - " AC TRANSIT\n", - " unique_agencies\n", + " agency\n", + " 6314\n", + " 6776\n", + " 7515\n", + " 7706\n", + " 9097\n", + " 9956\n", + " 9991\n", + " 10992\n", + " 11413\n", + " 13919\n", + " 14351\n", + " 14866\n", + " 15327\n", + " 15942\n", + " 15943\n", + " 17018\n", + " 17272\n", + " 17719\n", + " 17992\n", + " 18072\n", + " 18269\n", + " 18270\n", + " 19618\n", + " 20564\n", + " 21261\n", + " 22111\n", + " 22200\n", + " 22248\n", + " 22315\n", + " 22316\n", + " 22322\n", + " 22324\n", + " 22325\n", + " 22328\n", + " 22386\n", + " 22400\n", + " 22450\n", + " 22469\n", + " 22612\n", + " 22744\n", + " 22751\n", + " 22803\n", + " 22873\n", + " 24110\n", + " 24548\n", + " 24741\n", + " 24760\n", + " 24832\n", + " 25421\n", + " 25795\n", + " 27722\n", + " 31244\n", + " 31247\n", + " 31507\n", + " 32315\n", + " 34084\n", + " 35555\n", + " 37800\n", + " 37911\n", + " 38125\n", + " 39606\n", + " 40907\n", + " 40918\n", + " 40974\n", + " 40977\n", + " 40998\n", + " 42618\n", + " 45516\n", + " 45703\n", + " 46200\n", + " 46208\n", + " 46414\n", + " 46885\n", + " 51311\n", + " 51373\n", + " 53198\n", + " 53379\n", + " 53468\n", + " 53495\n", + " 58120\n", + " 60997\n", + " 61552\n", + " 63543\n", + " 72144\n", + " 73817\n", + " 75190\n", + " 75240\n", + " 75276\n", + " 75415\n", + " 75698\n", + " 75815\n", + " 75839\n", + " 80574\n", + " 80588\n", + " 80719\n", + " 82067\n", + " 82657\n", + " 82678\n", + " 84270\n", + " 84276\n", + " 85840\n", + " 86191\n", + " 87860\n", + " 90356\n", + " 90647\n", + " 90650\n", + " 91131\n", + " 91155\n", + " 94554\n", + " 97640\n", + " 97772\n", + " 97951\n", + " 98148\n", + " 98150\n", + " 98266\n", + " 104234\n", + " 104303\n", + " 104304\n", + " 104305\n", + " 104306\n", + " 104619\n", + " 104914\n", + " 109015\n", + " 109058\n", + " 109099\n", + " 112101\n", + " 112106\n", + " 114150\n", + " 114292\n", + " 114366\n", + " 114373\n", + " 115048\n", + " 115274\n", + " 115277\n", + " 115309\n", + " 115310\n", + " 115323\n", + " 115329\n", + " 115389\n", + " 115486\n", + " 115488\n", + " 115679\n", + " 115884\n", + " 116031\n", + " 116175\n", + " 116294\n", + " 116322\n", + " 116701\n", + " 116717\n", + " 116722\n", + " 116723\n", + " 116758\n", + " 116782\n", + " 117119\n", + " 117140\n", + " 119455\n", + " 119465\n", + " 119475\n", + " 125222\n", + " 127079\n", + " 127607\n", + " 127900\n", + " 127908\n", + " 127921\n", + " 127928\n", + " 127947\n", + " 128322\n", + " 128341\n", + " 128517\n", + " 128712\n", + " 129011\n", + " 129015\n", + " 130364\n", + " 131421\n", + " 132258\n", + " 136558\n", + " 137732\n", + " 138045\n", + " 138175\n", + " 138177\n", + " 138193\n", + " 138212\n", + " 138600\n", + " 144190\n", + " 144208\n", + " 144210\n", + " 144221\n", + " 144281\n", + " 144344\n", + " 144536\n", + " 150784\n", + " 157527\n", + " 158951\n", + " 165314\n", + " 169051\n", + " 173574\n", + " 173640\n", + " 174057\n", + " 174059\n", + " 174073\n", + " 174075\n", + " 174076\n", + " 174220\n", + " 174231\n", + " 174252\n", + " 174282\n", + " 174284\n", + " 174318\n", + " 174338\n", + " 174351\n", + " 174352\n", + " 174371\n", + " 174376\n", + " 174394\n", + " 174396\n", + " 174410\n", + " 174413\n", + " 174424\n", + " 174427\n", + " 174431\n", + " 174435\n", + " 174436\n", + " 174442\n", + " 174445\n", + " 174447\n", + " 174453\n", + " 174457\n", + " 174461\n", + " 174462\n", + " 174468\n", + " 174469\n", + " 174479\n", + " 174495\n", + " 174501\n", + " 174507\n", + " 174512\n", + " 174515\n", + " 174516\n", + " 174520\n", + " 174522\n", + " 174527\n", + " 174532\n", + " 174539\n", + " 174544\n", + " 174546\n", + " 174557\n", + " 174565\n", + " 174583\n", + " 174589\n", + " ...\n", + " 554774\n", + " 554776\n", + " 554777\n", + " 554790\n", + " 554791\n", + " 554798\n", + " 554803\n", + " 554814\n", + " 554820\n", + " 554822\n", + " 554838\n", + " 554846\n", + " 554905\n", + " 554916\n", + " 554982\n", + " 554992\n", + " 554995\n", + " 555007\n", + " 555011\n", + " 555039\n", + " 555044\n", + " 555047\n", + " 555062\n", + " 555066\n", + " 555075\n", + " 555108\n", + " 555113\n", + " 555116\n", + " 555119\n", + " 555120\n", + " 555121\n", + " 555122\n", + " 555123\n", + " 555124\n", + " 555125\n", + " 555126\n", + " 555128\n", + " 555129\n", + " 555132\n", + " 555170\n", + " 555195\n", + " 555210\n", + " 555211\n", + " 555212\n", + " 555222\n", + " 555232\n", + " 555235\n", + " 555242\n", + " 555260\n", + " 555262\n", + " 555286\n", + " 555292\n", + " 555309\n", + " 555319\n", + " 555338\n", + " 555347\n", + " 555364\n", + " 555374\n", + " 555391\n", + " 555397\n", + " 555433\n", + " 555448\n", + " 555455\n", + " 555460\n", + " 555608\n", + " 555615\n", + " 555659\n", + " 555723\n", + " 555796\n", + " 556927\n", + " 556929\n", + " 556977\n", + " 557004\n", + " 557013\n", + " 557020\n", + " 557334\n", + " 558239\n", + " 558820\n", + " 558950\n", + " 559126\n", + " 559130\n", + " 559170\n", + " 559197\n", + " 559302\n", + " 559327\n", + " 559328\n", + " 559343\n", + " 559374\n", + " 559382\n", + " 559421\n", + " 559532\n", + " 559578\n", + " 559623\n", + " 559629\n", + " 559630\n", + " 559634\n", + " 559636\n", + " 559637\n", + " 559638\n", + " 559676\n", + " 559695\n", + " 559764\n", + " 559774\n", + " 559786\n", + " 559790\n", + " 559822\n", + " 559823\n", + " 559829\n", + " 559846\n", + " 559877\n", + " 559880\n", + " 559891\n", + " 559892\n", + " 559893\n", + " 559894\n", + " 559895\n", + " 559897\n", + " 559898\n", + " 559900\n", + " 559911\n", + " 559929\n", + " 559955\n", + " 559978\n", + " 559985\n", + " 560030\n", + " 560078\n", + " 560123\n", + " 560157\n", + " 560168\n", + " 560224\n", + " 560244\n", + " 560668\n", + " 560682\n", + " 560884\n", + " 560895\n", + " 560899\n", + " 560900\n", + " 560903\n", + " 561359\n", + " 561560\n", + " 561593\n", + " 561638\n", + " 561640\n", + " 561641\n", + " 562114\n", + " 562422\n", + " 562435\n", + " 562449\n", + " 562466\n", + " 562481\n", + " 562504\n", + " 562512\n", + " 562544\n", + " 562644\n", + " 562649\n", + " 562657\n", + " 562664\n", + " 562668\n", + " 562674\n", + " 562686\n", + " 562697\n", + " 562698\n", + " 562702\n", + " 562703\n", + " 562714\n", + " 562760\n", + " 562763\n", + " 562768\n", + " 562799\n", + " 562801\n", + " 562802\n", + " 562803\n", + " 562805\n", + " 562809\n", + " 562812\n", + " 562814\n", + " 562815\n", + " 562817\n", + " 562818\n", + " 562820\n", + " 562824\n", + " 562826\n", + " 562827\n", + " 562830\n", + " 562833\n", + " 562838\n", + " 562845\n", + " 562901\n", + " 563209\n", + " 563598\n", + " 563610\n", + " 563693\n", + " 564530\n", + " 565065\n", + " 566230\n", + " 566321\n", + " 569501\n", + " 570273\n", + " 571259\n", + " 571458\n", + " 571464\n", + " 571482\n", + " 572527\n", + " 572940\n", + " 577860\n", + " 579492\n", + " 580859\n", + " 581626\n", + " 581663\n", + " 582985\n", + " 583213\n", + " 589739\n", + " 594654\n", + " 594665\n", + " 599627\n", + " 603740\n", + " 606355\n", + " 610612\n", + " 611097\n", + " 614566\n", + " 618762\n", + " 621188\n", + " 631490\n", + " 632820\n", + " 635259\n", + " 636145\n", + " 636158\n", + " 636162\n", + " 643970\n", + " 647810\n", + " 653707\n", + " 653714\n", + " 654910\n", + " 655077\n", + " 655097\n", + " 655143\n", + " 655177\n", + " 655348\n", + " 655423\n", + " 655555\n", + " 655878\n", + " 656246\n", + " 656542\n", + " 662436\n", + " 662905\n", + " 663640\n", + " 669529\n", + " 669567\n", + " 669894\n", + " 670345\n", " \n", " \n", " \n", " \n", - " 123\n", - " public_transit\n", - " light_rail, light_rail, bus, bus\n", - " San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa...\n", - " 4\n", - " 4\n", + " 0\n", + " AC TRANSIT\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 3\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 3\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " \n", + " \n", + " 1\n", + " San Francisco Bay Ferry\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 2\n", + " SolTrans\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 3\n", + " Caltrain\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 4\n", + " SamTrans\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 5\n", + " The S\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 6\n", + " Fairfield and Suisun Transit\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 7\n", + " Sacramento Regional Transit\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 8\n", + " Marin Transit\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 9\n", + " Tri Delta Transit\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 10\n", + " San Francisco Municipal Transportation Agency\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 2\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 2\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 2\n", + " 2\n", + " 3\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 1\n", + " 3\n", + " 3\n", + " 0\n", + " 2\n", + " 0\n", + " 1\n", + " 2\n", + " 1\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 3\n", + " 2\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 3\n", + " 4\n", + " 1\n", + " 1\n", + " 3\n", + " 2\n", + " 2\n", + " 3\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 2\n", + " 2\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 2\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 1\n", + " 2\n", + " 3\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 4\n", + " 1\n", + " 0\n", + " 3\n", + " 2\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 2\n", + " 1\n", + " 1\n", + " 2\n", + " 0\n", + " 0\n", + " 2\n", + " 2\n", + " 2\n", + " 2\n", + " 3\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 0\n", + " 2\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 3\n", + " 3\n", + " 2\n", + " 2\n", + " 2\n", + " 1\n", + " 1\n", + " 3\n", + " 3\n", + " 4\n", + " 3\n", + " 4\n", + " 1\n", + " 1\n", + " 1\n", + " 1\n", + " 3\n", + " 3\n", + " 0\n", + " 1\n", + " \n", + " \n", + " 11\n", + " Amtrak\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 12\n", + " San Joaquin Regional Transit District (RTD)\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 13\n", + " Bay Area Rapid Transit\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 1\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 14\n", + " Santa Cruz Metro\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " ...\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " \n", + " \n", + " 15\n", + " VTA\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 1\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", + " 0\n", " 0\n", " 0\n", " 0\n", @@ -3798,115 +11412,10 @@ " 0\n", " 0\n", " 0\n", - " 3\n", " 0\n", " 0\n", " 0\n", " 0\n", - " 1\n", - " AC TRANSIT, San Francisco Municipal Transportation Agency\n", - " \n", - " \n", - "\n", - "
" - ], - "text/plain": [ - " primary_mode transit_submode \\\n", - "123 public_transit light_rail, light_rail, bus, bus \n", - "\n", - " transit_agency \\\n", - "123 San Francisco Municipal Transportation Agency, San Francisco Municipal Transportation Agency, Sa... \n", - "\n", - " n n_modes_taken agency_count \\\n", - "123 4 4 2 \n", - "\n", - " San Joaquin Regional Transit District (RTD) San Francisco Bay Ferry \\\n", - "123 0 0 \n", - "\n", - " Tri Delta Transit Bay Area Rapid Transit Santa Cruz Metro SamTrans \\\n", - "123 0 0 0 0 \n", - "\n", - " nan The S Fairfield and Suisun Transit Marin Transit SolTrans \\\n", - "123 0 0 0 0 0 \n", - "\n", - " San Francisco Municipal Transportation Agency Caltrain Amtrak \\\n", - "123 3 0 0 \n", - "\n", - " Sacramento Regional Transit VTA AC TRANSIT \\\n", - "123 0 0 1 \n", - "\n", - " unique_agencies \n", - "123 AC TRANSIT, San Francisco Municipal Transportation Agency " - ] - }, - "execution_count": 108, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.sample()" - ] - }, - { - "cell_type": "code", - "execution_count": 140, - "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", - "metadata": {}, - "outputs": [], - "source": [ - "df_agencies = df.iloc[:, 6:23]" - ] - }, - { - "cell_type": "code", - "execution_count": 141, - "id": "0dd42b8d-b8d5-4cc4-bb62-cfef6c03c7e8", - "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", @@ -3923,10 +11432,6 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -3938,15 +11443,10 @@ " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -3958,15 +11458,10 @@ " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -3983,10 +11478,6 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -3998,55 +11489,146 @@ " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -4060,13 +11642,8 @@ " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -4078,19 +11655,12 @@ " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -4098,535 +11668,1278 @@ " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - "
San Joaquin Regional Transit District (RTD)San Francisco Bay FerryTri Delta TransitBay Area Rapid TransitSanta Cruz MetroSamTransnanThe SFairfield and Suisun TransitMarin TransitSolTransSan Francisco Municipal Transportation AgencyCaltrainAmtrakSacramento Regional TransitVTAAC TRANSIT
00000001
12000000100001
8000000100001
60000002
75000000100001
......................................................
12821000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000010000
1300000001002
133000000110001
1360001000000110001
14100010000001100001
\n", - "

144 rows × 17 columns

\n", - "
" - ], - "text/plain": [ - " San Joaquin Regional Transit District (RTD) San Francisco Bay Ferry \\\n", - "0 0 0 \n", - "12 0 0 \n", - "8 0 0 \n", - "6 0 0 \n", - "75 0 0 \n", - ".. ... ... \n", - "128 0 0 \n", - "130 0 0 \n", - "133 0 0 \n", - "136 0 0 \n", - "141 0 0 \n", - "\n", - " Tri Delta Transit Bay Area Rapid Transit Santa Cruz Metro SamTrans \\\n", - "0 0 0 0 0 \n", - "12 0 0 0 0 \n", - "8 0 0 0 0 \n", - "6 0 0 0 0 \n", - "75 0 0 0 0 \n", - ".. ... ... ... ... \n", - "128 0 0 0 1 \n", - "130 0 0 0 0 \n", - "133 0 0 0 0 \n", - "136 0 1 0 0 \n", - "141 0 1 0 0 \n", - "\n", - " nan The S Fairfield and Suisun Transit Marin Transit SolTrans \\\n", - "0 0 0 0 0 0 \n", - "12 0 0 0 0 0 \n", - "8 0 0 0 0 0 \n", - "6 0 0 0 0 0 \n", - "75 0 0 0 0 0 \n", - ".. ... ... ... ... ... \n", - "128 0 0 0 0 0 \n", - "130 0 0 0 0 0 \n", - "133 0 0 0 0 0 \n", - "136 0 0 0 0 0 \n", - "141 0 0 0 0 1 \n", - "\n", - " San Francisco Municipal Transportation Agency Caltrain Amtrak \\\n", - "0 0 0 0 \n", - "12 1 0 0 \n", - "8 1 0 0 \n", - "6 0 0 0 \n", - "75 1 0 0 \n", - ".. ... ... ... \n", - "128 0 1 0 \n", - "130 0 0 1 \n", - "133 1 1 0 \n", - "136 1 1 0 \n", - "141 1 0 0 \n", - "\n", - " Sacramento Regional Transit VTA AC TRANSIT \n", - "0 0 0 1 \n", - "12 0 0 1 \n", - "8 0 0 1 \n", - "6 0 0 2 \n", - "75 0 0 1 \n", - ".. ... ... ... \n", - "128 0 0 0 \n", - "130 0 0 2 \n", - "133 0 0 1 \n", - "136 0 0 1 \n", - "141 0 0 1 \n", - "\n", - "[144 rows x 17 columns]" - ] - }, - "execution_count": 141, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df_agencies" - ] - }, - { - "cell_type": "code", - "execution_count": 142, - "id": "814dde3a-d303-4044-9df1-464e408bf460", - "metadata": {}, - "outputs": [], - "source": [ - "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" - ] - }, - { - "cell_type": "code", - "execution_count": 143, - "id": "202923d2-b869-4a72-8a02-ce229a65d815", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/tmp/ipykernel_344/4109633324.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", - " df_agencies['n_taken'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" - ] - } - ], - "source": [ - "df_agencies['n_taken'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" - ] - }, - { - "cell_type": "code", - "execution_count": 145, - "id": "f79f946b-f47d-4332-bdf7-50afbf66171f", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", " \n", - " \n", " \n", " \n", " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", - " \n", - " \n", - " \n", " \n", - " \n", " \n", " \n", - " \n", - " \n", " \n", - " \n", " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", "
agency0128675143116313376139941132421297011764111114143777961011034639314045617912620308187138572781291113154318891123134135137432417482849599115121161825353946548610811012012513113214229171922232627283637384042444748495051525355565758596062656667686971738083858990929798100102103104105106107109112118119122124127128130133136141n_taken
16AC TRANSIT111210011000011220000001110111110200311010110000201110000020012121101041110110100010111210221301011102001201010000120000221110021111100202102111111
\n", + "

16 rows × 6034 columns

\n", "
" ], "text/plain": [ - " agency 0 12 8 6 75 14 3 116 31 33 76 139 94 113 24 21 \\\n", - "16 AC TRANSIT 1 1 1 2 1 0 0 1 1 0 0 0 0 1 1 2 \n", + " agency 6314 6776 7515 7706 \\\n", + "0 AC TRANSIT 0 1 1 1 \n", + "1 San Francisco Bay Ferry 0 0 0 0 \n", + "2 SolTrans 0 0 0 0 \n", + "3 Caltrain 0 0 0 0 \n", + "4 SamTrans 0 0 0 0 \n", + "5 The S 0 0 0 0 \n", + "6 Fairfield and Suisun Transit 0 0 0 0 \n", + "7 Sacramento Regional Transit 0 0 0 0 \n", + "8 Marin Transit 0 0 0 0 \n", + "9 Tri Delta Transit 0 0 0 0 \n", + "10 San Francisco Municipal Transportation Agency 2 1 1 1 \n", + "11 Amtrak 0 0 0 0 \n", + "12 San Joaquin Regional Transit District (RTD) 0 0 0 0 \n", + "13 Bay Area Rapid Transit 0 0 0 0 \n", + "14 Santa Cruz Metro 0 0 0 0 \n", + "15 VTA 0 0 0 0 \n", + "\n", + " 9097 9956 9991 10992 11413 13919 14351 14866 15327 15942 15943 \\\n", + "0 1 1 1 2 1 1 1 1 1 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 2 1 1 1 1 2 0 2 2 \n", + "11 0 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 17018 17272 17719 17992 18072 18269 18270 19618 20564 21261 \\\n", + "0 0 0 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 1 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 2 1 1 2 1 1 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 22111 22200 22248 22315 22316 22322 22324 22325 22328 22386 \\\n", + "0 1 1 1 1 1 1 2 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 1 0 0 0 0 0 0 1 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 0 1 1 0 2 0 1 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 22400 22450 22469 22612 22744 22751 22803 22873 24110 24548 \\\n", + "0 1 2 2 1 0 2 1 1 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 2 0 0 1 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 1 0 0 0 0 0 0 0 0 0 \n", + "5 0 1 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 0 0 1 1 1 1 0 2 2 \n", + "11 0 1 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 24741 24760 24832 25421 25795 27722 31244 31247 31507 32315 \\\n", + "0 0 0 0 1 1 1 0 0 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 3 1 2 1 2 1 3 3 0 2 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 34084 35555 37800 37911 38125 39606 40907 40918 40974 40977 \\\n", + "0 2 2 1 1 1 0 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 2 1 0 2 1 1 1 0 \n", + "11 1 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 40998 42618 45516 45703 46200 46208 46414 46885 51311 51373 \\\n", + "0 1 1 2 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 0 1 1 1 0 1 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 53198 53379 53468 53495 58120 60997 61552 63543 72144 73817 \\\n", + "0 1 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 1 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 1 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 1 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 0 2 0 0 0 1 0 0 2 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 1 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 1 0 0 \n", + "\n", + " 75190 75240 75276 75415 75698 75815 75839 80574 80588 80719 \\\n", + "0 1 3 1 1 1 1 1 1 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 0 1 1 1 1 1 0 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 1 1 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 1 0 0 \n", + "\n", + " 82067 82657 82678 84270 84276 85840 86191 87860 90356 90647 \\\n", + "0 0 0 1 1 1 1 1 1 3 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 2 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 2 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 3 2 0 1 0 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 1 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 90650 91131 91155 94554 97640 97772 97951 98148 98150 98266 \\\n", + "0 1 1 1 1 0 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 0 \n", + "10 1 2 1 1 2 1 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 104234 104303 104304 104305 104306 104619 104914 109015 109058 \\\n", + "0 2 0 0 0 0 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 1 1 2 2 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 1 1 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 109099 112101 112106 114150 114292 114366 114373 115048 115274 \\\n", + "0 1 1 0 1 2 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 1 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 2 0 2 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 1 1 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 115277 115309 115310 115323 115329 115389 115486 115488 115679 \\\n", + "0 1 1 0 1 0 0 1 1 0 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 2 1 3 4 1 1 3 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 115884 116031 116175 116294 116322 116701 116717 116722 116723 \\\n", + "0 0 0 0 0 0 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 2 3 2 1 1 1 2 2 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 116758 116782 117119 117140 119455 119465 119475 125222 127079 \\\n", + "0 1 1 1 1 0 0 0 1 0 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 1 \n", + "4 0 0 0 0 0 0 0 0 1 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 0 1 1 2 2 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 1 0 0 1 0 1 1 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 127607 127900 127908 127921 127928 127947 128322 128341 128517 \\\n", + "0 1 1 1 1 1 1 0 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 2 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 1 1 1 1 1 1 2 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 128712 129011 129015 130364 131421 132258 136558 137732 138045 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 1 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 2 1 2 1 2 2 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 29 70 117 64 111 114 143 7 77 96 101 10 34 63 93 140 45 \\\n", - "16 2 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 \n", + " 138175 138177 138193 138212 138600 144190 144208 144210 144221 \\\n", + "0 1 1 1 1 1 1 1 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 1 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 2 1 1 1 2 1 2 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 61 79 126 20 30 81 87 138 5 72 78 129 11 13 15 43 1 88 \\\n", - "16 2 0 0 3 1 1 0 1 0 1 1 0 0 0 0 2 0 1 \n", + " 144281 144344 144536 150784 157527 158951 165314 169051 173574 \\\n", + "0 0 1 1 1 0 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 2 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 1 1 2 0 1 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 91 123 134 135 137 4 32 41 74 82 84 95 99 115 121 16 18 \\\n", - "16 1 1 0 0 0 0 0 2 0 0 1 2 1 2 1 1 0 \n", + " 173640 174057 174059 174073 174075 174076 174220 174231 174252 \\\n", + "0 0 1 1 1 1 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 1 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 1 0 1 1 1 0 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 25 35 39 46 54 86 108 110 120 125 131 132 142 2 9 17 19 \\\n", - "16 1 0 4 1 1 1 0 1 1 0 1 0 0 0 1 0 1 \n", + " 174282 174284 174318 174338 174351 174352 174371 174376 174394 \\\n", + "0 1 1 1 1 1 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 0 0 0 0 2 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 22 23 26 27 28 36 37 38 40 42 44 47 48 49 50 51 52 53 \\\n", - "16 1 1 2 1 0 2 2 1 3 0 1 0 1 1 1 0 2 0 \n", + " 174396 174410 174413 174424 174427 174431 174435 174436 174442 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 0 0 1 2 0 0 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 55 56 57 58 59 60 62 65 66 67 68 69 71 73 80 83 85 89 \\\n", - "16 0 1 2 0 1 0 1 0 0 0 0 1 2 0 0 0 0 2 \n", + " 174445 174447 174453 174457 174461 174462 174468 174469 174479 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 2 0 2 2 0 1 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 90 92 97 98 100 102 103 104 105 106 107 109 112 118 119 \\\n", - "16 2 1 1 1 0 0 2 1 1 1 1 1 0 0 2 \n", + " 174495 174501 174507 174512 174515 174516 174520 174522 174527 \\\n", + "0 1 1 1 1 2 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 1 0 0 0 1 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", "\n", - " 122 124 127 128 130 133 136 141 n_taken \n", - "16 0 2 1 0 2 1 1 1 111 " + " 174532 174539 174544 174546 174557 174565 174583 174589 ... \\\n", + "0 2 1 2 1 2 1 1 1 ... \n", + "1 0 0 0 0 0 0 0 0 ... \n", + "2 0 0 0 0 0 0 0 0 ... \n", + "3 0 0 0 0 0 0 0 0 ... \n", + "4 0 0 0 0 0 0 0 0 ... \n", + "5 0 0 0 0 0 0 0 0 ... \n", + "6 0 0 0 0 0 0 0 0 ... \n", + "7 0 0 0 0 0 0 0 0 ... \n", + "8 0 0 0 0 0 0 0 0 ... \n", + "9 0 0 0 0 0 0 0 0 ... \n", + "10 0 0 0 1 0 0 0 0 ... \n", + "11 0 0 0 0 0 0 0 0 ... \n", + "12 0 0 0 0 0 0 0 0 ... \n", + "13 0 0 0 0 0 0 0 0 ... \n", + "14 0 0 0 0 0 0 0 0 ... \n", + "15 0 0 0 0 0 0 0 0 ... \n", + "\n", + " 554774 554776 554777 554790 554791 554798 554803 554814 554820 \\\n", + "0 0 0 0 1 1 2 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 1 0 1 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 0 2 0 0 0 0 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 2 1 0 0 0 0 0 0 0 \n", + "\n", + " 554822 554838 554846 554905 554916 554982 554992 554995 555007 \\\n", + "0 1 2 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 0 1 1 0 0 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555011 555039 555044 555047 555062 555066 555075 555108 555113 \\\n", + "0 1 1 1 1 1 1 2 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 1 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 0 1 1 1 0 1 1 \n", + "11 0 0 1 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555116 555119 555120 555121 555122 555123 555124 555125 555126 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 0 1 0 0 1 2 2 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555128 555129 555132 555170 555195 555210 555211 555212 555222 \\\n", + "0 1 1 1 1 1 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 1 1 1 1 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555232 555235 555242 555260 555262 555286 555292 555309 555319 \\\n", + "0 1 1 1 0 0 0 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 2 2 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 1 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555338 555347 555364 555374 555391 555397 555433 555448 555455 \\\n", + "0 2 1 1 1 1 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 1 1 1 1 1 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 555460 555608 555615 555659 555723 555796 556927 556929 556977 \\\n", + "0 1 1 1 1 2 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 1 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 2 1 2 0 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 557004 557013 557020 557334 558239 558820 558950 559126 559130 \\\n", + "0 0 0 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 3 1 0 0 0 1 0 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 559170 559197 559302 559327 559328 559343 559374 559382 559421 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 1 0 0 0 1 1 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 0 1 2 1 1 1 2 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 559532 559578 559623 559629 559630 559634 559636 559637 559638 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 1 1 1 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 559676 559695 559764 559774 559786 559790 559822 559823 559829 \\\n", + "0 0 0 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 0 0 0 0 0 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 1 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 559846 559877 559880 559891 559892 559893 559894 559895 559897 \\\n", + "0 2 1 1 1 1 2 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 1 0 1 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 0 1 0 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 559898 559900 559911 559929 559955 559978 559985 560030 560078 \\\n", + "0 1 1 1 1 2 1 0 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 2 2 1 1 1 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 1 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 560123 560157 560168 560224 560244 560668 560682 560884 560895 \\\n", + "0 1 1 1 1 1 1 1 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 1 0 1 1 1 1 4 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 560899 560900 560903 561359 561560 561593 561638 561640 561641 \\\n", + "0 2 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 3 2 1 1 0 0 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 562114 562422 562435 562449 562466 562481 562504 562512 562544 \\\n", + "0 1 1 0 1 1 2 2 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 1 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 0 0 0 0 0 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 562644 562649 562657 562664 562668 562674 562686 562697 562698 \\\n", + "0 1 1 1 1 1 1 1 1 2 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 1 0 0 0 0 \n", + "3 0 0 0 1 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 0 0 1 1 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 1 0 0 1 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 562702 562703 562714 562760 562763 562768 562799 562801 562802 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 1 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 1 1 0 0 0 1 0 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 562803 562805 562809 562812 562814 562815 562817 562818 562820 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 1 1 1 1 0 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 562824 562826 562827 562830 562833 562838 562845 562901 563209 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 1 1 1 1 1 0 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 563598 563610 563693 564530 565065 566230 566321 569501 570273 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 0 0 0 1 1 1 1 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 1 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 571259 571458 571464 571482 572527 572940 577860 579492 580859 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 2 1 1 1 2 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 581626 581663 582985 583213 589739 594654 594665 599627 603740 \\\n", + "0 1 1 1 1 2 0 0 1 0 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 2 0 0 2 2 2 2 3 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 606355 610612 611097 614566 618762 621188 631490 632820 635259 \\\n", + "0 1 1 1 1 1 1 1 1 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 2 1 1 1 0 2 1 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 636145 636158 636162 643970 647810 653707 653714 654910 655077 \\\n", + "0 1 1 1 1 1 0 0 0 0 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 2 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 1 1 1 1 1 3 3 2 2 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 655097 655143 655177 655348 655423 655555 655878 656246 656542 \\\n", + "0 0 1 1 0 0 0 0 0 1 \n", + "1 0 0 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 0 0 \n", + "10 2 1 1 3 3 4 3 4 1 \n", + "11 0 0 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 0 0 \n", + "\n", + " 662436 662905 663640 669529 669567 669894 670345 \n", + "0 0 1 1 0 0 1 1 \n", + "1 0 0 0 0 0 0 0 \n", + "2 0 0 0 0 0 0 0 \n", + "3 0 0 0 0 0 0 0 \n", + "4 0 0 0 0 0 0 0 \n", + "5 0 0 0 0 0 0 0 \n", + "6 0 0 0 0 0 0 0 \n", + "7 0 0 0 0 0 0 0 \n", + "8 0 0 0 0 0 0 0 \n", + "9 0 0 0 0 0 0 0 \n", + "10 1 1 1 3 3 0 1 \n", + "11 0 0 0 0 0 0 0 \n", + "12 0 0 0 0 0 0 0 \n", + "13 0 0 0 0 0 0 0 \n", + "14 0 0 0 0 0 0 0 \n", + "15 0 0 0 0 0 0 0 \n", + "\n", + "[16 rows x 6034 columns]" ] }, - "execution_count": 145, + "execution_count": 294, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df_agencies.sample()" + "df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 295, + "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_305/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" + ] + } + ], + "source": [ + "df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" ] }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 296, "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", "metadata": {}, "outputs": [], "source": [ - "df_agencies = df_agencies>>select(_.agency, _.n_taken)" + "df_agencies = df_agencies>>select(_.agency, _.n_trips)" ] }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 302, "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], "source": [ - "tooltip_cols = [\"agency\", \"n_taken\"]" + "tooltip_cols = [\"agency\", \"n_trips\"]" ] }, { "cell_type": "code", - "execution_count": 157, + "execution_count": 303, + "id": "f1267faf-e28c-4208-ae79-43b31f67f705", + "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", + "
agencyn_trips
0AC TRANSIT5438
1San Francisco Bay Ferry4
2SolTrans54
3Caltrain50
4SamTrans72
5The S6
6Fairfield and Suisun Transit1
7Sacramento Regional Transit9
8Marin Transit4
9Tri Delta Transit1
10San Francisco Municipal Transportation Agency3840
11Amtrak17
12San Joaquin Regional Transit District (RTD)0
13Bay Area Rapid Transit261
14Santa Cruz Metro1
15VTA33
\n", + "
" + ], + "text/plain": [ + " agency n_trips\n", + "0 AC TRANSIT 5438\n", + "1 San Francisco Bay Ferry 4\n", + "2 SolTrans 54\n", + "3 Caltrain 50\n", + "4 SamTrans 72\n", + "5 The S 6\n", + "6 Fairfield and Suisun Transit 1\n", + "7 Sacramento Regional Transit 9\n", + "8 Marin Transit 4\n", + "9 Tri Delta Transit 1\n", + "10 San Francisco Municipal Transportation Agency 3840\n", + "11 Amtrak 17\n", + "12 San Joaquin Regional Transit District (RTD) 0\n", + "13 Bay Area Rapid Transit 261\n", + "14 Santa Cruz Metro 1\n", + "15 VTA 33" + ] + }, + "execution_count": 303, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 304, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, "outputs": [ @@ -4635,23 +12948,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 157, + "execution_count": 304, "metadata": {}, "output_type": "execute_result" } @@ -4714,8 +13027,8 @@ " .mark_bar()\n", " .encode(\n", " x=alt.X(\"agency\", title = \"Agency Name\"),\n", - " y=alt.Y(\"n_taken\", title= \"Number of times agency was used for trip\"),\n", - " color=alt.Color(\"n_taken\", scale=alt.Scale(range = cp.CALITP_SEQUENTIAL_COLORS)),\n", + " y=alt.Y(\"n_trips\", title= \"Number of boardings reported for trips (One person taking two AC Transit trips will count as 2)\"),\n", + " color=alt.Color(\"n_trips\", scale=alt.Scale(range = cp.CALITP_SEQUENTIAL_COLORS)),\n", " tooltip = tooltip_cols)\n", " .properties(title = \"Number of Times an Agency was used for Trip taking over Bay Bridge\",\n", " width=800,\n", @@ -4742,7 +13055,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 305, "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", "metadata": {}, "outputs": [ @@ -4765,7 +13078,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 83, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -4778,7 +13091,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 84, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -4880,7 +13193,7 @@ "8 public_transit visitor 47" ] }, - "execution_count": 74, + "execution_count": 84, "metadata": {}, "output_type": "execute_result" } @@ -4891,7 +13204,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 306, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -4900,23 +13213,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 75, + "execution_count": 306, "metadata": {}, "output_type": "execute_result" } @@ -4979,8 +13292,8 @@ " alt.Chart(trip_by_res_type)\n", " .mark_bar()\n", " .encode(\n", - " x=alt.X(\"primary_mode\"),\n", - " y=alt.Y(\"number_trips\"),\n", + " x=alt.X(\"primary_mode\", title = \"Mode\"),\n", + " y=alt.Y(\"number_trips\", title = \"Number of Trips\"),\n", " color=alt.Color(\"trip_taker_resident_type\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", " domain=trip_by_res_type[\"trip_taker_resident_type\"].unique().tolist())\n", " ),\n", @@ -5002,7 +13315,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 86, "id": "878c5c8e-18c3-456a-b641-67ad010f5101", "metadata": {}, "outputs": [ @@ -5025,7 +13338,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 87, "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", "metadata": {}, "outputs": [ @@ -5132,7 +13445,7 @@ "[262323 rows x 2 columns]" ] }, - "execution_count": 77, + "execution_count": 87, "metadata": {}, "output_type": "execute_result" } @@ -5143,7 +13456,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 88, "id": "eb9780a3-b996-45af-9cc3-b41629ec0e55", "metadata": {}, "outputs": [ @@ -5166,7 +13479,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 89, "id": "6fc3be54-b8dc-4cf8-893e-565ffa02934d", "metadata": {}, "outputs": [ @@ -5254,59 +13567,59 @@ " \n", " \n", " \n", - " 594837\n", + " 656110\n", " single_family\n", - " 27\n", + " 9\n", " indo_european\n", " 179.03 (San Francisco, CA)\n", " 8194219563640751815\n", - " female\n", + " male\n", " 1 (Tract 179.03, San Francisco, CA)\n", " California\n", " California\n", - " white_not_hispanic_or_latino\n", + " asian_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 30.0\n", - " 812437883885019816\n", - " 2 (Tract 3690.01, Contra Costa, CA)\n", - " office\n", - " employed_not_working\n", + " 39.0\n", + " 13541098643571256698\n", + " 1 (Tract 615.07, San Francisco, CA)\n", + " retail\n", + " unemployed_under_16_not_in_labor_force\n", " California\n", - " Contra Costa\n", - " 1 (Tract 179.03, San Francisco, CA)\n", - " 3690.01 (Contra Costa, CA)\n", + " San Francisco\n", + " Does not have work/school location\n", + " 615.07 (San Francisco, CA)\n", " 1200990.0\n", " 1 (Tract 179.03, San Francisco, CA)\n", - " worked_from_home\n", + " other_travel_mode\n", " three_plus\n", - " auto_passenger\n", + " private_auto\n", " home\n", " single_family\n", " NaN\n", - " California\n", + " Does not have work/school location\n", " 10.0\n", " San Francisco\n", - " office\n", - " naics61\n", + " mixed_use\n", + " naics72\n", " renter\n", - " unknown_fuel_type\n", - " 179.03 (San Francisco, CA)\n", + " other_non_bev\n", " 179.03 (San Francisco, CA)\n", - " bachelors_degree\n", - " 15:15:00\n", - " 58975.0\n", - " employed\n", - " shop\n", + " Does not have work/school location\n", + " high_school\n", + " 18:10:00\n", + " 78984.0\n", + " unemployed\n", + " eat\n", " single_family\n", - " San Francisco\n", - " 15.3\n", + " Does not have work/school location\n", + " 3.9\n", " not_attending_school\n", " San Francisco\n", - " 2310331066900902679\n", - " 15:42:31\n", + " 12894946300265742193\n", + " 18:19:12\n", " \n", " \n", "\n", @@ -5314,67 +13627,73 @@ ], "text/plain": [ " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "594837 single_family 27 indo_european \n", + "656110 single_family 9 indo_european \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "594837 179.03 (San Francisco, CA) 8194219563640751815 female \n", + "656110 179.03 (San Francisco, CA) 8194219563640751815 male \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "594837 1 (Tract 179.03, San Francisco, CA) California \n", + "656110 1 (Tract 179.03, San Francisco, CA) California \n", "\n", " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", - "594837 California white_not_hispanic_or_latino NaN \n", + "656110 California asian_not_hispanic_or_latino NaN \n", "\n", " transit_route trip_taker_resident_type vehicle_type \\\n", - "594837 NaN core unknown_vehicle_type \n", + "656110 NaN core unknown_vehicle_type \n", "\n", - " trip_taker_age activity_id \\\n", - "594837 30.0 812437883885019816 \n", + " trip_taker_age activity_id \\\n", + "656110 39.0 13541098643571256698 \n", "\n", " destination_bgrp_2020 destination_building_use \\\n", - "594837 2 (Tract 3690.01, Contra Costa, CA) office \n", + "656110 1 (Tract 615.07, San Francisco, CA) retail \n", "\n", - " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", - "594837 employed_not_working California Contra Costa \n", + " trip_taker_wfh destination_st_2020 \\\n", + "656110 unemployed_under_16_not_in_labor_force California \n", "\n", - " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", - "594837 1 (Tract 179.03, San Francisco, CA) 3690.01 (Contra Costa, CA) \n", + " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", + "656110 San Francisco Does not have work/school location \n", "\n", - " trip_taker_household_income origin_bgrp_2020 \\\n", - "594837 1200990.0 1 (Tract 179.03, San Francisco, CA) \n", + " destination_trct_2020 trip_taker_household_income \\\n", + "656110 615.07 (San Francisco, CA) 1200990.0 \n", "\n", - " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", - "594837 worked_from_home three_plus auto_passenger \n", + " origin_bgrp_2020 trip_taker_commute_mode \\\n", + "656110 1 (Tract 179.03, San Francisco, CA) other_travel_mode \n", "\n", - " previous_trip_purpose trip_taker_building_type transit_submode \\\n", - "594837 home single_family NaN \n", + " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", + "656110 three_plus private_auto home \n", "\n", - " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", - "594837 California 10.0 San Francisco \n", + " trip_taker_building_type transit_submode \\\n", + "656110 single_family NaN \n", "\n", - " destination_land_use trip_taker_industry trip_taker_tenure \\\n", - "594837 office naics61 renter \n", + " trip_taker_work_st_2020 trip_taker_household_size \\\n", + "656110 Does not have work/school location 10.0 \n", "\n", - " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "594837 unknown_fuel_type 179.03 (San Francisco, CA) \n", + " origin_cty_2020 destination_land_use trip_taker_industry \\\n", + "656110 San Francisco mixed_use naics72 \n", "\n", - " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", - "594837 179.03 (San Francisco, CA) bachelors_degree 15:15:00 \n", + " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "656110 renter other_non_bev 179.03 (San Francisco, CA) \n", "\n", - " trip_taker_individual_income trip_taker_employment_status \\\n", - "594837 58975.0 employed \n", + " trip_taker_work_trct_2020 trip_taker_education \\\n", + "656110 Does not have work/school location high_school \n", "\n", - " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", - "594837 shop single_family San Francisco \n", + " trip_start_time trip_taker_individual_income \\\n", + "656110 18:10:00 78984.0 \n", "\n", - " trip_distance_miles trip_taker_school_grade_attending \\\n", - "594837 15.3 not_attending_school \n", + " trip_taker_employment_status trip_purpose origin_land_use \\\n", + "656110 unemployed eat single_family \n", + "\n", + " trip_taker_work_cty_2020 trip_distance_miles \\\n", + "656110 Does not have work/school location 3.9 \n", + "\n", + " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", + "656110 not_attending_school San Francisco \n", "\n", - " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", - "594837 San Francisco 2310331066900902679 15:42:31 " + " trip_taker_person_id trip_end_time \n", + "656110 12894946300265742193 18:19:12 " ] }, - "execution_count": 79, + "execution_count": 89, "metadata": {}, "output_type": "execute_result" } @@ -5386,7 +13705,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 90, "id": "4eccfdf8-429e-43df-899e-f7d77e051831", "metadata": {}, "outputs": [ @@ -5499,7 +13818,7 @@ "6 10.0 6 " ] }, - "execution_count": 80, + "execution_count": 90, "metadata": {}, "output_type": "execute_result" } @@ -5536,7 +13855,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 91, "id": "dea31a60-e986-41e7-b31b-1e5403c9e041", "metadata": {}, "outputs": [ @@ -5563,7 +13882,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 92, "id": "42bc1220-b404-4aca-8214-43992c55163b", "metadata": {}, "outputs": [ @@ -5619,239 +13938,225 @@ " \n", " \n", " \n", - " 291566\n", - " 2136622139014372291\n", - " Visitor (no work/school location)\n", - " NaN\n", - " visitor\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " Visitor (no home location)\n", - " Visitor (no home location)\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " Visitor (no home location)\n", - " NaN\n", - " NaN\n", - " Visitor (no home location)\n", - " \n", - " NaN\n", + " 49193\n", + " 8682903469007956812\n", + " California\n", + " 0.0\n", + " core\n", + " GQ_language\n", + " unknown_num_vehicles\n", + " asian_not_hispanic_or_latino\n", + " some_college\n", + " 1 (Tract 9820, Alameda, CA)\n", + " unemployed_under_16_not_in_labor_force\n", + " Alameda\n", + " 4228 (Alameda, CA)\n", + " GQ\n", + " naics72\n", + " 9820 (Alameda, CA)\n", + " undergraduate\n", + " GQ_structure\n", + " other_travel_mode\n", + " not_in_labor_force\n", + " Alameda\n", + " 0.0\n", + " California\n", + " male\n", + " 1.0\n", + " 1 (Tract 4228, Alameda, CA)\n", + " 13526119813432325617\n", + " 19.0\n", " \n", " \n", - " 61360\n", - " 18045049985050730039\n", + " 107374\n", + " 17790302872816909985\n", " California\n", - " 118709.0\n", + " 138822.0\n", " core\n", " english\n", - " two\n", + " one\n", " white_not_hispanic_or_latino\n", " bachelors_degree\n", - " 2 (Tract 6023, San Mateo, CA)\n", + " 1 (Tract 101.01, San Francisco, CA)\n", " in_person\n", " Alameda\n", - " 4307 (Alameda, CA)\n", - " owner\n", - " naics561710\n", - " 6023 (San Mateo, CA)\n", + " 4041.01 (Alameda, CA)\n", + " renter\n", + " naics445299\n", + " 101.01 (San Francisco, CA)\n", " not_attending_school\n", - " single_family\n", - " auto_passenger\n", + " multiple_units\n", + " private_auto\n", " employed\n", - " San Mateo\n", - " 45472.0\n", + " San Francisco\n", + " 21861.0\n", " California\n", " female\n", " 2.0\n", - " 1 (Tract 4307, Alameda, CA)\n", - " 1519924226481489849\n", - " 50.0\n", + " 1 (Tract 4041.01, Alameda, CA)\n", + " 9400661008842675581\n", + " 31.0\n", " \n", " \n", - " 102148\n", - " 18252093590434207441\n", + " 102026\n", + " 1840847354523713052\n", " California\n", - " 159591.0\n", + " 878322.0\n", " core\n", - " english\n", + " spanish\n", " three_plus\n", " white_not_hispanic_or_latino\n", - " high_school\n", - " 3 (Tract 4090, Alameda, CA)\n", - " in_person\n", + " some_college\n", + " 1 (Tract 6133, San Mateo, CA)\n", + " remote\n", " San Mateo\n", - " 6136 (San Mateo, CA)\n", + " 6133 (San Mateo, CA)\n", " owner\n", - " naics441110\n", - " 4090 (Alameda, CA)\n", - " not_attending_school\n", + " naics81\n", + " 6133 (San Mateo, CA)\n", + " undergraduate\n", " single_family\n", - " private_auto\n", + " worked_from_home\n", " employed\n", - " Alameda\n", - " 57933.0\n", + " San Mateo\n", + " 10711.0\n", " California\n", - " female\n", - " 4.0\n", - " 1 (Tract 6136, San Mateo, CA)\n", - " 6796407519054968347\n", - " 55.0\n", + " male\n", + " 6.0\n", + " 1 (Tract 6133, San Mateo, CA)\n", + " 1316252144924345956\n", + " 22.0\n", " \n", " \n", - " 44035\n", - " 4418639892432880734\n", + " 16433\n", + " 5785746260697777731\n", " California\n", - " 41197.0\n", + " 219234.0\n", " core\n", - " english\n", - " one\n", - " white_not_hispanic_or_latino\n", - " advanced_degree\n", - " 4 (Tract 210, San Francisco, CA)\n", + " spanish\n", + " three_plus\n", + " asian_not_hispanic_or_latino\n", + " bachelors_degree\n", + " 1 (Tract 615.01, San Francisco, CA)\n", " in_person\n", " Alameda\n", - " 4105 (Alameda, CA)\n", - " renter\n", - " naics713940\n", - " 210 (San Francisco, CA)\n", + " 4010 (Alameda, CA)\n", + " owner\n", + " naics6214\n", + " 615.01 (San Francisco, CA)\n", " not_attending_school\n", " several_units\n", - " public_transit\n", + " auto_passenger\n", " employed\n", " San Francisco\n", - " 41197.0\n", + " 52528.0\n", " California\n", - " male\n", - " 1.0\n", - " 1 (Tract 4105, Alameda, CA)\n", - " 7180642291609392163\n", + " female\n", + " 12.0\n", + " 2 (Tract 4010, Alameda, CA)\n", + " 8580484783011523505\n", " 27.0\n", " \n", " \n", - " 198787\n", - " 18116489537752852575\n", - " Does not have work/school location\n", - " 47834.0\n", + " 245251\n", + " 16188142531198959675\n", + " California\n", + " 142102.0\n", " core\n", - " asian_pacific\n", - " two\n", - " asian_not_hispanic_or_latino\n", + " indo_european\n", + " three_plus\n", + " two_races_not_hispanic_or_latino\n", " some_college\n", - " Does not have work/school location\n", - " unemployed_under_16_not_in_labor_force\n", - " Santa Clara\n", - " 5066.01 (Santa Clara, CA)\n", - " renter\n", - " not_working\n", - " Does not have work/school location\n", - " not_attending_school\n", - " several_units\n", - " other_travel_mode\n", - " not_in_labor_force\n", - " Does not have work/school location\n", - " 35540.0\n", + " 2 (Tract 177, San Francisco, CA)\n", + " employed_not_working\n", + " Contra Costa\n", + " 3382.04 (Contra Costa, CA)\n", + " owner\n", + " naics451110\n", + " 177 (San Francisco, CA)\n", + " undergraduate\n", + " single_family\n", + " public_transit\n", + " employed\n", + " San Francisco\n", + " 8744.0\n", " California\n", " female\n", - " 2.0\n", - " 1 (Tract 5066.01, Santa Clara, CA)\n", - " 3063171708127119513\n", - " 77.0\n", + " 4.0\n", + " 2 (Tract 3382.04, Contra Costa, CA)\n", + " 16409011573581227320\n", + " 20.0\n", " \n", " \n", "\n", "
" ], "text/plain": [ - " person_id work_st_2020 \\\n", - "291566 2136622139014372291 Visitor (no work/school location) \n", - "61360 18045049985050730039 California \n", - "102148 18252093590434207441 California \n", - "44035 4418639892432880734 California \n", - "198787 18116489537752852575 Does not have work/school location \n", - "\n", - " household_income resident_type language available_vehicles \\\n", - "291566 NaN visitor NaN NaN \n", - "61360 118709.0 core english two \n", - "102148 159591.0 core english three_plus \n", - "44035 41197.0 core english one \n", - "198787 47834.0 core asian_pacific two \n", - "\n", - " race_ethnicity education \\\n", - "291566 NaN NaN \n", - "61360 white_not_hispanic_or_latino bachelors_degree \n", - "102148 white_not_hispanic_or_latino high_school \n", - "44035 white_not_hispanic_or_latino advanced_degree \n", - "198787 asian_not_hispanic_or_latino some_college \n", - "\n", - " work_bgrp_2020 \\\n", - "291566 Visitor (no work/school location) \n", - "61360 2 (Tract 6023, San Mateo, CA) \n", - "102148 3 (Tract 4090, Alameda, CA) \n", - "44035 4 (Tract 210, San Francisco, CA) \n", - "198787 Does not have work/school location \n", - "\n", - " wfh home_cty_2020 \\\n", - "291566 NaN Visitor (no home location) \n", - "61360 in_person Alameda \n", - "102148 in_person San Mateo \n", - "44035 in_person Alameda \n", - "198787 unemployed_under_16_not_in_labor_force Santa Clara \n", + " person_id work_st_2020 household_income resident_type \\\n", + "49193 8682903469007956812 California 0.0 core \n", + "107374 17790302872816909985 California 138822.0 core \n", + "102026 1840847354523713052 California 878322.0 core \n", + "16433 5785746260697777731 California 219234.0 core \n", + "245251 16188142531198959675 California 142102.0 core \n", + "\n", + " language available_vehicles race_ethnicity \\\n", + "49193 GQ_language unknown_num_vehicles asian_not_hispanic_or_latino \n", + "107374 english one white_not_hispanic_or_latino \n", + "102026 spanish three_plus white_not_hispanic_or_latino \n", + "16433 spanish three_plus asian_not_hispanic_or_latino \n", + "245251 indo_european three_plus two_races_not_hispanic_or_latino \n", + "\n", + " education work_bgrp_2020 \\\n", + "49193 some_college 1 (Tract 9820, Alameda, CA) \n", + "107374 bachelors_degree 1 (Tract 101.01, San Francisco, CA) \n", + "102026 some_college 1 (Tract 6133, San Mateo, CA) \n", + "16433 bachelors_degree 1 (Tract 615.01, San Francisco, CA) \n", + "245251 some_college 2 (Tract 177, San Francisco, CA) \n", + "\n", + " wfh home_cty_2020 \\\n", + "49193 unemployed_under_16_not_in_labor_force Alameda \n", + "107374 in_person Alameda \n", + "102026 remote San Mateo \n", + "16433 in_person Alameda \n", + "245251 employed_not_working Contra Costa \n", "\n", " home_trct_2020 tenure industry \\\n", - "291566 Visitor (no home location) NaN NaN \n", - "61360 4307 (Alameda, CA) owner naics561710 \n", - "102148 6136 (San Mateo, CA) owner naics441110 \n", - "44035 4105 (Alameda, CA) renter naics713940 \n", - "198787 5066.01 (Santa Clara, CA) renter not_working \n", - "\n", - " work_trct_2020 school_grade_attending \\\n", - "291566 Visitor (no work/school location) NaN \n", - "61360 6023 (San Mateo, CA) not_attending_school \n", - "102148 4090 (Alameda, CA) not_attending_school \n", - "44035 210 (San Francisco, CA) not_attending_school \n", - "198787 Does not have work/school location not_attending_school \n", - "\n", - " building_type commute_mode employment_status \\\n", - "291566 NaN NaN NaN \n", - "61360 single_family auto_passenger employed \n", - "102148 single_family private_auto employed \n", - "44035 several_units public_transit employed \n", - "198787 several_units other_travel_mode not_in_labor_force \n", - "\n", - " work_cty_2020 individual_income \\\n", - "291566 Visitor (no work/school location) NaN \n", - "61360 San Mateo 45472.0 \n", - "102148 Alameda 57933.0 \n", - "44035 San Francisco 41197.0 \n", - "198787 Does not have work/school location 35540.0 \n", - "\n", - " home_st_2020 sex household_size \\\n", - "291566 Visitor (no home location) NaN NaN \n", - "61360 California female 2.0 \n", - "102148 California female 4.0 \n", - "44035 California male 1.0 \n", - "198787 California female 2.0 \n", - "\n", - " home_bgrp_2020 household_id age \n", - "291566 Visitor (no home location) NaN \n", - "61360 1 (Tract 4307, Alameda, CA) 1519924226481489849 50.0 \n", - "102148 1 (Tract 6136, San Mateo, CA) 6796407519054968347 55.0 \n", - "44035 1 (Tract 4105, Alameda, CA) 7180642291609392163 27.0 \n", - "198787 1 (Tract 5066.01, Santa Clara, CA) 3063171708127119513 77.0 " + "49193 4228 (Alameda, CA) GQ naics72 \n", + "107374 4041.01 (Alameda, CA) renter naics445299 \n", + "102026 6133 (San Mateo, CA) owner naics81 \n", + "16433 4010 (Alameda, CA) owner naics6214 \n", + "245251 3382.04 (Contra Costa, CA) owner naics451110 \n", + "\n", + " work_trct_2020 school_grade_attending building_type \\\n", + "49193 9820 (Alameda, CA) undergraduate GQ_structure \n", + "107374 101.01 (San Francisco, CA) not_attending_school multiple_units \n", + "102026 6133 (San Mateo, CA) undergraduate single_family \n", + "16433 615.01 (San Francisco, CA) not_attending_school several_units \n", + "245251 177 (San Francisco, CA) undergraduate single_family \n", + "\n", + " commute_mode employment_status work_cty_2020 \\\n", + "49193 other_travel_mode not_in_labor_force Alameda \n", + "107374 private_auto employed San Francisco \n", + "102026 worked_from_home employed San Mateo \n", + "16433 auto_passenger employed San Francisco \n", + "245251 public_transit employed San Francisco \n", + "\n", + " individual_income home_st_2020 sex household_size \\\n", + "49193 0.0 California male 1.0 \n", + "107374 21861.0 California female 2.0 \n", + "102026 10711.0 California male 6.0 \n", + "16433 52528.0 California female 12.0 \n", + "245251 8744.0 California female 4.0 \n", + "\n", + " home_bgrp_2020 household_id age \n", + "49193 1 (Tract 4228, Alameda, CA) 13526119813432325617 19.0 \n", + "107374 1 (Tract 4041.01, Alameda, CA) 9400661008842675581 31.0 \n", + "102026 1 (Tract 6133, San Mateo, CA) 1316252144924345956 22.0 \n", + "16433 2 (Tract 4010, Alameda, CA) 8580484783011523505 27.0 \n", + "245251 2 (Tract 3382.04, Contra Costa, CA) 16409011573581227320 20.0 " ] }, - "execution_count": 82, + "execution_count": 92, "metadata": {}, "output_type": "execute_result" } @@ -5862,7 +14167,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 93, "id": "570daf6d-06b8-46e5-9664-a71c5a093073", "metadata": {}, "outputs": [ @@ -5912,7 +14217,7 @@ "1 visitor 23034" ] }, - "execution_count": 83, + "execution_count": 93, "metadata": {}, "output_type": "execute_result" } @@ -5923,7 +14228,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 94, "id": "2f4b67bf-78ab-4aa8-bbb0-e382a8f78c9a", "metadata": {}, "outputs": [ @@ -6105,7 +14410,7 @@ "13 worked_from_home male 18621 253921.717631 137849.973686 41.092208" ] }, - "execution_count": 84, + "execution_count": 94, "metadata": {}, "output_type": "execute_result" } @@ -6124,7 +14429,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 95, "id": "2e4bd058-9c4d-4989-a5fc-db6cf6130bf2", "metadata": {}, "outputs": [ @@ -6267,7 +14572,7 @@ "8 38.312382 " ] }, - "execution_count": 85, + "execution_count": 95, "metadata": {}, "output_type": "execute_result" } @@ -6319,7 +14624,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 96, "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", "metadata": {}, "outputs": [], @@ -6329,7 +14634,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 97, "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", "metadata": {}, "outputs": [], @@ -6339,7 +14644,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 98, "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", "metadata": {}, "outputs": [ @@ -6388,76 +14693,76 @@ " \n", " \n", " \n", - " 890\n", + " 134\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1114495634\n", - " I 80 / 395419317 / 1\n", + " 1020456908\n", + " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", " Motorway\n", - " 0.213\n", + " 0.077\n", " yes\n", - " 82\n", - " EAST\n", + " 221\n", + " WEST\n", " no\n", - " 2: Weekend Day (Sa-Su)\n", - " 20: 4pm (4pm-5pm)\n", - " 8306\n", - " 61\n", - " 13\n", - " 69.063\n", - " 1773.10\n", - " 1.13\n", - " False\n", - " 69\n", + " 1: Weekday (M-F)\n", + " 14: Mid-Day (10am-4pm)\n", + " 48401\n", + " 52\n", + " 5\n", + " 68.747\n", + " 3719.29\n", + " 1.33\n", + " True\n", + " 67\n", " \n", " \n", - " 1022\n", + " 453\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1118036302\n", - " I 80 / 839972875 / 1\n", + " 1050419851\n", + " San Francisco – Oakland Bay Bridge / 179235221 / 1\n", " Motorway\n", - " 0.006\n", + " 0.004\n", " yes\n", - " 265\n", - " WEST\n", + " 38\n", + " EAST\n", " no\n", - " 1: Weekday (M-F)\n", - " 02: Early AM (12am-6am)\n", - " 15514\n", - " 60\n", + " 0: All Days (M-Su)\n", + " 03: 1am (1am-2am)\n", + " 1726\n", + " 66\n", " 2\n", - " 68.762\n", - " 86.14\n", - " 1.14\n", + " 67.840\n", + " 7.44\n", + " 1.03\n", " False\n", - " 73\n", + " 75\n", " \n", " \n", - " 1707\n", + " 1572\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1135393455\n", - " I 80 / 781148922 / 1\n", + " 1133975975\n", + " San Francisco – Oakland Bay Bridge / 929579737 / 1\n", " Motorway\n", - " 0.256\n", + " 0.273\n", " yes\n", - " 265\n", + " 215\n", " WEST\n", " no\n", - " 2: Weekend Day (Sa-Su)\n", - " 27: 9pm (9pm-10pm)\n", - " 3922\n", + " 1: Weekday (M-F)\n", + " 12: 9am (9am-10am)\n", + " 8910\n", + " 38\n", + " 30\n", + " 68.634\n", + " 2436.35\n", + " 1.83\n", + " True\n", " 59\n", - " 16\n", - " 67.716\n", - " 1004.32\n", - " 1.16\n", - " False\n", - " 67\n", " \n", " \n", - " 523\n", + " 472\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", " 1050419851\n", @@ -6468,39 +14773,39 @@ " 38\n", " EAST\n", " no\n", - " 2: Weekend Day (Sa-Su)\n", - " 13: 10am (10am-11am)\n", - " 8316\n", - " 58\n", + " 0: All Days (M-Su)\n", + " 22: 5pm (5pm-6pm)\n", + " 10393\n", + " 42\n", " 2\n", " 67.840\n", - " 35.87\n", - " 1.17\n", - " False\n", - " 68\n", + " 44.83\n", + " 1.62\n", + " True\n", + " 57\n", " \n", " \n", - " 1287\n", + " 1534\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 1\n", + " 1133975975\n", + " San Francisco – Oakland Bay Bridge / 929579737 / 1\n", " Motorway\n", - " 0.177\n", + " 0.273\n", " yes\n", - " 43\n", - " EAST\n", + " 215\n", + " WEST\n", " no\n", " 0: All Days (M-Su)\n", - " 27: 9pm (9pm-10pm)\n", - " 6579\n", - " 59\n", - " 11\n", - " 67.749\n", - " 1163.44\n", - " 1.15\n", + " 04: 2am (2am-3am)\n", + " 855\n", + " 68\n", + " 14\n", + " 68.634\n", + " 233.79\n", + " 1.01\n", " False\n", - " 67\n", + " 75\n", " \n", " \n", "\n", @@ -6508,70 +14813,70 @@ ], "text/plain": [ " data_periods \\\n", - "890 Jan 01, 2022 - Dec 31, 2022 \n", - "1022 Jan 01, 2022 - Dec 31, 2022 \n", - "1707 Jan 01, 2022 - Dec 31, 2022 \n", - "523 Jan 01, 2022 - Dec 31, 2022 \n", - "1287 Jan 01, 2022 - Dec 31, 2022 \n", + "134 Jan 01, 2022 - Dec 31, 2022 \n", + "453 Jan 01, 2022 - Dec 31, 2022 \n", + "1572 Jan 01, 2022 - Dec 31, 2022 \n", + "472 Jan 01, 2022 - Dec 31, 2022 \n", + "1534 Jan 01, 2022 - Dec 31, 2022 \n", "\n", " mode_of_travel zone_id \\\n", - "890 All Vehicles CVD Plus - StL All Vehicles Volume 1114495634 \n", - "1022 All Vehicles CVD Plus - StL All Vehicles Volume 1118036302 \n", - "1707 All Vehicles CVD Plus - StL All Vehicles Volume 1135393455 \n", - "523 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", - "1287 All Vehicles CVD Plus - StL All Vehicles Volume 1128174334 \n", + "134 All Vehicles CVD Plus - StL All Vehicles Volume 1020456908 \n", + "453 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", + "1572 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", + "472 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", + "1534 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", "\n", " zone_name road_classification \\\n", - "890 I 80 / 395419317 / 1 Motorway \n", - "1022 I 80 / 839972875 / 1 Motorway \n", - "1707 I 80 / 781148922 / 1 Motorway \n", - "523 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", - "1287 San Francisco – Oakland Bay Bridge / 237731428 / 1 Motorway \n", + "134 San Francisco – Oakland Bay Bridge / 23874736 / 1 Motorway \n", + "453 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", + "1572 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", + "472 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", + "1534 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", "\n", " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "890 0.213 yes 82 \n", - "1022 0.006 yes 265 \n", - "1707 0.256 yes 265 \n", - "523 0.004 yes 38 \n", - "1287 0.177 yes 43 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "890 EAST no 2: Weekend Day (Sa-Su) \n", - "1022 WEST no 1: Weekday (M-F) \n", - "1707 WEST no 2: Weekend Day (Sa-Su) \n", - "523 EAST no 2: Weekend Day (Sa-Su) \n", - "1287 EAST no 0: All Days (M-Su) \n", + "134 0.077 yes 221 \n", + "453 0.004 yes 38 \n", + "1572 0.273 yes 215 \n", + "472 0.004 yes 38 \n", + "1534 0.273 yes 215 \n", "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "890 20: 4pm (4pm-5pm) 8306 \n", - "1022 02: Early AM (12am-6am) 15514 \n", - "1707 27: 9pm (9pm-10pm) 3922 \n", - "523 13: 10am (10am-11am) 8316 \n", - "1287 27: 9pm (9pm-10pm) 6579 \n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "134 WEST no 1: Weekday (M-F) \n", + "453 EAST no 0: All Days (M-Su) \n", + "1572 WEST no 1: Weekday (M-F) \n", + "472 EAST no 0: All Days (M-Su) \n", + "1534 WEST no 0: All Days (M-Su) \n", + "\n", + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "134 14: Mid-Day (10am-4pm) 48401 \n", + "453 03: 1am (1am-2am) 1726 \n", + "1572 12: 9am (9am-10am) 8910 \n", + "472 22: 5pm (5pm-6pm) 10393 \n", + "1534 04: 2am (2am-3am) 855 \n", "\n", " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "890 61 13 \n", - "1022 60 2 \n", - "1707 59 16 \n", - "523 58 2 \n", - "1287 59 11 \n", + "134 52 5 \n", + "453 66 2 \n", + "1572 38 30 \n", + "472 42 2 \n", + "1534 68 14 \n", "\n", " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "890 69.063 1773.10 \n", - "1022 68.762 86.14 \n", - "1707 67.716 1004.32 \n", - "523 67.840 35.87 \n", - "1287 67.749 1163.44 \n", + "134 68.747 3719.29 \n", + "453 67.840 7.44 \n", + "1572 68.634 2436.35 \n", + "472 67.840 44.83 \n", + "1534 68.634 233.79 \n", "\n", " travel_time_index congested_segment _85th_speed_percentile \n", - "890 1.13 False 69 \n", - "1022 1.14 False 73 \n", - "1707 1.16 False 67 \n", - "523 1.17 False 68 \n", - "1287 1.15 False 67 " + "134 1.33 True 67 \n", + "453 1.03 False 75 \n", + "1572 1.83 True 59 \n", + "472 1.62 True 57 \n", + "1534 1.01 False 75 " ] }, - "execution_count": 88, + "execution_count": 98, "metadata": {}, "output_type": "execute_result" } @@ -6590,7 +14895,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 99, "id": "da10c3eb-31bd-437e-b546-82472d66f964", "metadata": {}, "outputs": [ @@ -6600,7 +14905,7 @@ "1710" ] }, - "execution_count": 89, + "execution_count": 99, "metadata": {}, "output_type": "execute_result" } @@ -6611,7 +14916,7 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 100, "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", "metadata": {}, "outputs": [ @@ -6783,7 +15088,7 @@ "18 1135393455 I 80 / 781148922 / 1 90" ] }, - "execution_count": 90, + "execution_count": 100, "metadata": {}, "output_type": "execute_result" } @@ -6794,7 +15099,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 101, "id": "cd1ce590-2019-43f0-ba09-786520479ad8", "metadata": {}, "outputs": [ @@ -7012,7 +15317,7 @@ "29 29: 11pm (11pm-12am) 3" ] }, - "execution_count": 91, + "execution_count": 101, "metadata": {}, "output_type": "execute_result" } @@ -7031,7 +15336,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 102, "id": "57c890a6-c667-4917-a090-b85f1aadcad7", "metadata": {}, "outputs": [], @@ -7041,7 +15346,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 103, "id": "0a059c82-c7c8-43b9-92a6-178b42101828", "metadata": {}, "outputs": [ @@ -7051,7 +15356,7 @@ "19" ] }, - "execution_count": 93, + "execution_count": 103, "metadata": {}, "output_type": "execute_result" } @@ -7062,7 +15367,7 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 104, "id": "67213733-9905-42bd-912e-cf943cd66b40", "metadata": {}, "outputs": [ @@ -7234,7 +15539,7 @@ "18 1135393455 I 80 / 781148922 / 1 1" ] }, - "execution_count": 94, + "execution_count": 104, "metadata": {}, "output_type": "execute_result" } @@ -7245,7 +15550,7 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 105, "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", "metadata": {}, "outputs": [ @@ -7349,7 +15654,7 @@ "1530 1.39 True 67 " ] }, - "execution_count": 95, + "execution_count": 105, "metadata": {}, "output_type": "execute_result" } @@ -7360,7 +15665,7 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 106, "id": "28292f62-b2ab-46cb-ac08-b728facdfdc0", "metadata": {}, "outputs": [ @@ -7409,73 +15714,73 @@ " \n", " \n", " \n", - " 1530\n", + " 180\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1133975975\n", - " San Francisco – Oakland Bay Bridge / 929579737 / 1\n", + " 1022959400\n", + " San Francisco – Oakland Bay Bridge / 661905446 / 1\n", " Motorway\n", - " 0.273\n", + " 1.939\n", " yes\n", - " 215\n", - " WEST\n", + " 40\n", + " EAST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 128139\n", + " 131167\n", " 49\n", - " 23\n", - " 68.634\n", - " 35038.3\n", - " 1.39\n", + " 149\n", + " 64.627\n", + " 254292.0\n", + " 1.32\n", " True\n", - " 67\n", + " 61\n", " \n", " \n", - " 900\n", + " 1440\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1117259749\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 2\n", + " 1132861884\n", + " I 80 / 236348365 / 1\n", " Motorway\n", - " 1.961\n", + " 0.006\n", " yes\n", - " 80\n", + " 85\n", " EAST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 150733\n", - " 60\n", - " 121\n", - " 70.594\n", - " 295555.0\n", - " 1.18\n", + " 128581\n", + " 63\n", + " 2\n", + " 70.532\n", + " 725.2\n", + " 1.12\n", " False\n", - " 70\n", + " 72\n", " \n", " \n", - " 360\n", + " 1620\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1036056766\n", - " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", + " 1135393455\n", + " I 80 / 781148922 / 1\n", " Motorway\n", - " 0.073\n", + " 0.256\n", " yes\n", - " 37\n", - " EAST\n", + " 265\n", + " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 158493\n", - " 51\n", - " 5\n", - " 67.267\n", - " 11532.2\n", - " 1.32\n", + " 104573\n", + " 53\n", + " 18\n", + " 67.716\n", + " 26778.5\n", + " 1.28\n", " True\n", - " 66\n", + " 67\n", " \n", " \n", "\n", @@ -7483,52 +15788,52 @@ ], "text/plain": [ " data_periods \\\n", - "1530 Jan 01, 2022 - Dec 31, 2022 \n", - "900 Jan 01, 2022 - Dec 31, 2022 \n", - "360 Jan 01, 2022 - Dec 31, 2022 \n", + "180 Jan 01, 2022 - Dec 31, 2022 \n", + "1440 Jan 01, 2022 - Dec 31, 2022 \n", + "1620 Jan 01, 2022 - Dec 31, 2022 \n", "\n", " mode_of_travel zone_id \\\n", - "1530 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", - "900 All Vehicles CVD Plus - StL All Vehicles Volume 1117259749 \n", - "360 All Vehicles CVD Plus - StL All Vehicles Volume 1036056766 \n", + "180 All Vehicles CVD Plus - StL All Vehicles Volume 1022959400 \n", + "1440 All Vehicles CVD Plus - StL All Vehicles Volume 1132861884 \n", + "1620 All Vehicles CVD Plus - StL All Vehicles Volume 1135393455 \n", "\n", " zone_name road_classification \\\n", - "1530 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", - "900 San Francisco – Oakland Bay Bridge / 237731428 / 2 Motorway \n", - "360 San Francisco – Oakland Bay Bridge / 52721870 / 1 Motorway \n", + "180 San Francisco – Oakland Bay Bridge / 661905446 / 1 Motorway \n", + "1440 I 80 / 236348365 / 1 Motorway \n", + "1620 I 80 / 781148922 / 1 Motorway \n", "\n", " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "1530 0.273 yes 215 \n", - "900 1.961 yes 80 \n", - "360 0.073 yes 37 \n", + "180 1.939 yes 40 \n", + "1440 0.006 yes 85 \n", + "1620 0.256 yes 265 \n", "\n", " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "1530 WEST no 0: All Days (M-Su) \n", - "900 EAST no 0: All Days (M-Su) \n", - "360 EAST no 0: All Days (M-Su) \n", + "180 EAST no 0: All Days (M-Su) \n", + "1440 EAST no 0: All Days (M-Su) \n", + "1620 WEST no 0: All Days (M-Su) \n", "\n", " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "1530 00: All Day (12am-12am) 128139 \n", - "900 00: All Day (12am-12am) 150733 \n", - "360 00: All Day (12am-12am) 158493 \n", + "180 00: All Day (12am-12am) 131167 \n", + "1440 00: All Day (12am-12am) 128581 \n", + "1620 00: All Day (12am-12am) 104573 \n", "\n", " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "1530 49 23 \n", - "900 60 121 \n", - "360 51 5 \n", + "180 49 149 \n", + "1440 63 2 \n", + "1620 53 18 \n", "\n", " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "1530 68.634 35038.3 \n", - "900 70.594 295555.0 \n", - "360 67.267 11532.2 \n", + "180 64.627 254292.0 \n", + "1440 70.532 725.2 \n", + "1620 67.716 26778.5 \n", "\n", " travel_time_index congested_segment _85th_speed_percentile \n", - "1530 1.39 True 67 \n", - "900 1.18 False 70 \n", - "360 1.32 True 66 " + "180 1.32 True 61 \n", + "1440 1.12 False 72 \n", + "1620 1.28 True 67 " ] }, - "execution_count": 96, + "execution_count": 106, "metadata": {}, "output_type": "execute_result" } @@ -7539,7 +15844,7 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 107, "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", "metadata": {}, "outputs": [ @@ -7608,7 +15913,7 @@ "1 50.333333 41.777778 123029.777778 1107268 " ] }, - "execution_count": 97, + "execution_count": 107, "metadata": {}, "output_type": "execute_result" } @@ -7622,7 +15927,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 108, "id": "778d58f0-25b7-4cf7-b60a-10e773055f48", "metadata": {}, "outputs": [], @@ -7664,7 +15969,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 109, "id": "29eab191-4eaa-445c-b444-49048135ef3b", "metadata": {}, "outputs": [], @@ -7686,7 +15991,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 110, "id": "896b63a9-b881-418a-ba40-dbea63f81614", "metadata": {}, "outputs": [], @@ -7700,7 +16005,7 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 111, "id": "cac29684-36ac-488b-b2d1-044ab5ef86c0", "metadata": {}, "outputs": [ @@ -7757,7 +16062,7 @@ "5 59.6 29.5 23240.7 232407 " ] }, - "execution_count": 101, + "execution_count": 111, "metadata": {}, "output_type": "execute_result" } @@ -7768,7 +16073,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 112, "id": "637afffc-560f-4485-985a-d6ee73dd65a7", "metadata": {}, "outputs": [ @@ -7777,23 +16082,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 287, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -2899,7 +2498,7 @@ }, { "cell_type": "code", - "execution_count": 288, + "execution_count": 75, "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", "metadata": {}, "outputs": [ @@ -2973,7 +2572,7 @@ "75 AC TRANSIT, San Francisco Municipal Transportation Agency" ] }, - "execution_count": 288, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -3002,7 +2601,7 @@ }, { "cell_type": "code", - "execution_count": 289, + "execution_count": 76, "id": "8af03d60-4537-44d3-b82f-d857625e47c3", "metadata": {}, "outputs": [], @@ -3028,111 +2627,17 @@ }, { "cell_type": "code", - "execution_count": 291, + "execution_count": 124, "id": "6951b590-cef8-44bd-b27d-0b18893609c5", "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", - "
transit_agencyAC TRANSITnanFairfield and Suisun TransitSolTransThe SSamTransCaltrainSan Francisco Bay FerrySacramento Regional TransitMarin TransitTri Delta TransitAmtrakSan Joaquin Regional Transit District (RTD)San Francisco Municipal Transportation AgencySanta Cruz MetroBay Area Rapid TransitVTAunique_agencies
180902AC TRANSIT10000000000000000AC TRANSIT
\n", - "
" - ], - "text/plain": [ - " transit_agency AC TRANSIT nan Fairfield and Suisun Transit \\\n", - "180902 AC TRANSIT 1 0 0 \n", - "\n", - " SolTrans The S SamTrans Caltrain San Francisco Bay Ferry \\\n", - "180902 0 0 0 0 0 \n", - "\n", - " Sacramento Regional Transit Marin Transit Tri Delta Transit Amtrak \\\n", - "180902 0 0 0 0 \n", - "\n", - " San Joaquin Regional Transit District (RTD) \\\n", - "180902 0 \n", - "\n", - " San Francisco Municipal Transportation Agency Santa Cruz Metro \\\n", - "180902 0 0 \n", - "\n", - " Bay Area Rapid Transit VTA unique_agencies \n", - "180902 0 0 AC TRANSIT " - ] - }, - "execution_count": 291, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "agency_indv_count.sample()" + "# agency_indv_count.sample()" ] }, { "cell_type": "code", - "execution_count": 292, + "execution_count": 78, "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", "metadata": {}, "outputs": [], @@ -3142,7 +2647,7 @@ }, { "cell_type": "code", - "execution_count": 293, + "execution_count": 79, "id": "814dde3a-d303-4044-9df1-464e408bf460", "metadata": {}, "outputs": [], @@ -3152,9847 +2657,119 @@ }, { "cell_type": "code", - "execution_count": 294, + "execution_count": 123, "id": "84174911-2243-430c-ab73-1fecb2552094", "metadata": {}, + "outputs": [], + "source": [ + "# df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_306/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" + ] + } + ], + "source": [ + "df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = df_agencies>>select(_.agency, _.n_trips)" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", + "metadata": {}, + "outputs": [], + "source": [ + "tooltip_cols = [\"agency\", \"n_trips\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "id": "f1267faf-e28c-4208-ae79-43b31f67f705", + "metadata": {}, + "outputs": [], + "source": [ + "# df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", + "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", - "\n", + "
\n", + "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 306, + "execution_count": 159, "metadata": {}, "output_type": "execute_result" } @@ -13298,7 +3075,7 @@ " domain=trip_by_res_type[\"trip_taker_resident_type\"].unique().tolist())\n", " ),\n", " tooltip=trip_by_res_type.columns.tolist())\n", - " .properties(\n", + " .properties(title = \"Trips by Resident Type\",\n", " width=800,\n", " height=500)\n", " )\n", @@ -13315,7 +3092,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 90, "id": "878c5c8e-18c3-456a-b641-67ad010f5101", "metadata": {}, "outputs": [ @@ -13338,7 +3115,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 91, "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", "metadata": {}, "outputs": [ @@ -13445,7 +3222,7 @@ "[262323 rows x 2 columns]" ] }, - "execution_count": 87, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -13456,7 +3233,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 92, "id": "eb9780a3-b996-45af-9cc3-b41629ec0e55", "metadata": {}, "outputs": [ @@ -13479,7 +3256,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 93, "id": "6fc3be54-b8dc-4cf8-893e-565ffa02934d", "metadata": {}, "outputs": [ @@ -13567,59 +3344,59 @@ " \n", " \n", " \n", - " 656110\n", - " single_family\n", - " 9\n", + " 594972\n", + " retail\n", + " 6\n", " indo_european\n", - " 179.03 (San Francisco, CA)\n", + " 615.06 (San Francisco, CA)\n", " 8194219563640751815\n", " male\n", " 1 (Tract 179.03, San Francisco, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 39.0\n", - " 13541098643571256698\n", - " 1 (Tract 615.07, San Francisco, CA)\n", - " retail\n", - " unemployed_under_16_not_in_labor_force\n", + " 27.0\n", + " 1397390795811450502\n", + " 1 (Tract 179.03, San Francisco, CA)\n", + " single_family\n", + " remote\n", " California\n", " San Francisco\n", - " Does not have work/school location\n", - " 615.07 (San Francisco, CA)\n", - " 1200990.0\n", " 1 (Tract 179.03, San Francisco, CA)\n", - " other_travel_mode\n", + " 179.03 (San Francisco, CA)\n", + " 1200990.0\n", + " 3 (Tract 615.06, San Francisco, CA)\n", + " worked_from_home\n", " three_plus\n", - " private_auto\n", - " home\n", + " auto_passenger\n", + " shop\n", " single_family\n", " NaN\n", - " Does not have work/school location\n", + " California\n", " 10.0\n", " San Francisco\n", - " mixed_use\n", - " naics72\n", + " single_family\n", + " naics54\n", " renter\n", - " other_non_bev\n", + " unknown_fuel_type\n", " 179.03 (San Francisco, CA)\n", - " Does not have work/school location\n", - " high_school\n", - " 18:10:00\n", - " 78984.0\n", - " unemployed\n", - " eat\n", - " single_family\n", - " Does not have work/school location\n", - " 3.9\n", + " 179.03 (San Francisco, CA)\n", + " bachelors_degree\n", + " 11:24:00\n", + " 218735.0\n", + " employed\n", + " home\n", + " mixed_use\n", + " San Francisco\n", + " 3.7\n", " not_attending_school\n", " San Francisco\n", - " 12894946300265742193\n", - " 18:19:12\n", + " 14409692340574959811\n", + " 11:30:46\n", " \n", " \n", "\n", @@ -13627,73 +3404,67 @@ ], "text/plain": [ " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "656110 single_family 9 indo_european \n", + "594972 retail 6 indo_european \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "656110 179.03 (San Francisco, CA) 8194219563640751815 male \n", + "594972 615.06 (San Francisco, CA) 8194219563640751815 male \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "656110 1 (Tract 179.03, San Francisco, CA) California \n", + "594972 1 (Tract 179.03, San Francisco, CA) California \n", "\n", " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", - "656110 California asian_not_hispanic_or_latino NaN \n", + "594972 California white_not_hispanic_or_latino NaN \n", "\n", " transit_route trip_taker_resident_type vehicle_type \\\n", - "656110 NaN core unknown_vehicle_type \n", + "594972 NaN core unknown_vehicle_type \n", "\n", - " trip_taker_age activity_id \\\n", - "656110 39.0 13541098643571256698 \n", + " trip_taker_age activity_id \\\n", + "594972 27.0 1397390795811450502 \n", "\n", " destination_bgrp_2020 destination_building_use \\\n", - "656110 1 (Tract 615.07, San Francisco, CA) retail \n", - "\n", - " trip_taker_wfh destination_st_2020 \\\n", - "656110 unemployed_under_16_not_in_labor_force California \n", - "\n", - " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", - "656110 San Francisco Does not have work/school location \n", + "594972 1 (Tract 179.03, San Francisco, CA) single_family \n", "\n", - " destination_trct_2020 trip_taker_household_income \\\n", - "656110 615.07 (San Francisco, CA) 1200990.0 \n", + " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", + "594972 remote California San Francisco \n", "\n", - " origin_bgrp_2020 trip_taker_commute_mode \\\n", - "656110 1 (Tract 179.03, San Francisco, CA) other_travel_mode \n", + " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", + "594972 1 (Tract 179.03, San Francisco, CA) 179.03 (San Francisco, CA) \n", "\n", - " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", - "656110 three_plus private_auto home \n", + " trip_taker_household_income origin_bgrp_2020 \\\n", + "594972 1200990.0 3 (Tract 615.06, San Francisco, CA) \n", "\n", - " trip_taker_building_type transit_submode \\\n", - "656110 single_family NaN \n", + " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", + "594972 worked_from_home three_plus auto_passenger \n", "\n", - " trip_taker_work_st_2020 trip_taker_household_size \\\n", - "656110 Does not have work/school location 10.0 \n", + " previous_trip_purpose trip_taker_building_type transit_submode \\\n", + "594972 shop single_family NaN \n", "\n", - " origin_cty_2020 destination_land_use trip_taker_industry \\\n", - "656110 San Francisco mixed_use naics72 \n", + " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", + "594972 California 10.0 San Francisco \n", "\n", - " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "656110 renter other_non_bev 179.03 (San Francisco, CA) \n", + " destination_land_use trip_taker_industry trip_taker_tenure \\\n", + "594972 single_family naics54 renter \n", "\n", - " trip_taker_work_trct_2020 trip_taker_education \\\n", - "656110 Does not have work/school location high_school \n", + " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "594972 unknown_fuel_type 179.03 (San Francisco, CA) \n", "\n", - " trip_start_time trip_taker_individual_income \\\n", - "656110 18:10:00 78984.0 \n", + " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", + "594972 179.03 (San Francisco, CA) bachelors_degree 11:24:00 \n", "\n", - " trip_taker_employment_status trip_purpose origin_land_use \\\n", - "656110 unemployed eat single_family \n", + " trip_taker_individual_income trip_taker_employment_status \\\n", + "594972 218735.0 employed \n", "\n", - " trip_taker_work_cty_2020 trip_distance_miles \\\n", - "656110 Does not have work/school location 3.9 \n", + " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", + "594972 home mixed_use San Francisco \n", "\n", - " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", - "656110 not_attending_school San Francisco \n", + " trip_distance_miles trip_taker_school_grade_attending \\\n", + "594972 3.7 not_attending_school \n", "\n", - " trip_taker_person_id trip_end_time \n", - "656110 12894946300265742193 18:19:12 " + " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", + "594972 San Francisco 14409692340574959811 11:30:46 " ] }, - "execution_count": 89, + "execution_count": 93, "metadata": {}, "output_type": "execute_result" } @@ -13705,7 +3476,7 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 94, "id": "4eccfdf8-429e-43df-899e-f7d77e051831", "metadata": {}, "outputs": [ @@ -13818,7 +3589,7 @@ "6 10.0 6 " ] }, - "execution_count": 90, + "execution_count": 94, "metadata": {}, "output_type": "execute_result" } @@ -13855,7 +3626,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 95, "id": "dea31a60-e986-41e7-b31b-1e5403c9e041", "metadata": {}, "outputs": [ @@ -13863,7 +3634,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_305/1951040339.py:1: DtypeWarning: Columns (25) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_306/1951040339.py:1: DtypeWarning: Columns (25) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_ppl = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_ppl}\"))\n" ] } @@ -13882,7 +3653,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 134, "id": "42bc1220-b404-4aca-8214-43992c55163b", "metadata": {}, "outputs": [ @@ -13938,236 +3709,109 @@ " \n", " \n", " \n", - " 49193\n", - " 8682903469007956812\n", - " California\n", - " 0.0\n", - " core\n", - " GQ_language\n", - " unknown_num_vehicles\n", - " asian_not_hispanic_or_latino\n", - " some_college\n", - " 1 (Tract 9820, Alameda, CA)\n", - " unemployed_under_16_not_in_labor_force\n", - " Alameda\n", - " 4228 (Alameda, CA)\n", - " GQ\n", - " naics72\n", - " 9820 (Alameda, CA)\n", - " undergraduate\n", - " GQ_structure\n", - " other_travel_mode\n", - " not_in_labor_force\n", - " Alameda\n", - " 0.0\n", - " California\n", - " male\n", - " 1.0\n", - " 1 (Tract 4228, Alameda, CA)\n", - " 13526119813432325617\n", - " 19.0\n", - " \n", - " \n", - " 107374\n", - " 17790302872816909985\n", - " California\n", - " 138822.0\n", + " 183579\n", + " 14190272423718015740\n", + " Does not have work/school location\n", + " 80134.0\n", " core\n", " english\n", - " one\n", - " white_not_hispanic_or_latino\n", - " bachelors_degree\n", - " 1 (Tract 101.01, San Francisco, CA)\n", - " in_person\n", - " Alameda\n", - " 4041.01 (Alameda, CA)\n", - " renter\n", - " naics445299\n", - " 101.01 (San Francisco, CA)\n", - " not_attending_school\n", - " multiple_units\n", - " private_auto\n", - " employed\n", - " San Francisco\n", - " 21861.0\n", - " California\n", - " female\n", - " 2.0\n", - " 1 (Tract 4041.01, Alameda, CA)\n", - " 9400661008842675581\n", - " 31.0\n", - " \n", - " \n", - " 102026\n", - " 1840847354523713052\n", - " California\n", - " 878322.0\n", - " core\n", - " spanish\n", " three_plus\n", " white_not_hispanic_or_latino\n", - " some_college\n", - " 1 (Tract 6133, San Mateo, CA)\n", - " remote\n", - " San Mateo\n", - " 6133 (San Mateo, CA)\n", - " owner\n", - " naics81\n", - " 6133 (San Mateo, CA)\n", - " undergraduate\n", - " single_family\n", - " worked_from_home\n", - " employed\n", - " San Mateo\n", - " 10711.0\n", - " California\n", - " male\n", - " 6.0\n", - " 1 (Tract 6133, San Mateo, CA)\n", - " 1316252144924345956\n", - " 22.0\n", - " \n", - " \n", - " 16433\n", - " 5785746260697777731\n", - " California\n", - " 219234.0\n", - " core\n", - " spanish\n", - " three_plus\n", - " asian_not_hispanic_or_latino\n", - " bachelors_degree\n", - " 1 (Tract 615.01, San Francisco, CA)\n", - " in_person\n", - " Alameda\n", - " 4010 (Alameda, CA)\n", + " high_school\n", + " Does not have work/school location\n", + " unemployed_under_16_not_in_labor_force\n", + " San Joaquin\n", + " 41.04 (San Joaquin, CA)\n", " owner\n", - " naics6214\n", - " 615.01 (San Francisco, CA)\n", + " not_working\n", + " Does not have work/school location\n", " not_attending_school\n", - " several_units\n", - " auto_passenger\n", - " employed\n", - " San Francisco\n", - " 52528.0\n", - " California\n", - " female\n", - " 12.0\n", - " 2 (Tract 4010, Alameda, CA)\n", - " 8580484783011523505\n", - " 27.0\n", - " \n", - " \n", - " 245251\n", - " 16188142531198959675\n", - " California\n", - " 142102.0\n", - " core\n", - " indo_european\n", - " three_plus\n", - " two_races_not_hispanic_or_latino\n", - " some_college\n", - " 2 (Tract 177, San Francisco, CA)\n", - " employed_not_working\n", - " Contra Costa\n", - " 3382.04 (Contra Costa, CA)\n", - " owner\n", - " naics451110\n", - " 177 (San Francisco, CA)\n", - " undergraduate\n", " single_family\n", - " public_transit\n", - " employed\n", - " San Francisco\n", - " 8744.0\n", + " other_travel_mode\n", + " not_in_labor_force\n", + " Does not have work/school location\n", + " 12629.0\n", " California\n", " female\n", - " 4.0\n", - " 2 (Tract 3382.04, Contra Costa, CA)\n", - " 16409011573581227320\n", - " 20.0\n", + " 3.0\n", + " 2 (Tract 41.04, San Joaquin, CA)\n", + " 5519997059193984488\n", + " 58.0\n", " \n", " \n", "\n", "
" ], "text/plain": [ - " person_id work_st_2020 household_income resident_type \\\n", - "49193 8682903469007956812 California 0.0 core \n", - "107374 17790302872816909985 California 138822.0 core \n", - "102026 1840847354523713052 California 878322.0 core \n", - "16433 5785746260697777731 California 219234.0 core \n", - "245251 16188142531198959675 California 142102.0 core \n", + " person_id work_st_2020 \\\n", + "183579 14190272423718015740 Does not have work/school location \n", + "\n", + " household_income resident_type language available_vehicles \\\n", + "183579 80134.0 core english three_plus \n", "\n", - " language available_vehicles race_ethnicity \\\n", - "49193 GQ_language unknown_num_vehicles asian_not_hispanic_or_latino \n", - "107374 english one white_not_hispanic_or_latino \n", - "102026 spanish three_plus white_not_hispanic_or_latino \n", - "16433 spanish three_plus asian_not_hispanic_or_latino \n", - "245251 indo_european three_plus two_races_not_hispanic_or_latino \n", + " race_ethnicity education \\\n", + "183579 white_not_hispanic_or_latino high_school \n", "\n", - " education work_bgrp_2020 \\\n", - "49193 some_college 1 (Tract 9820, Alameda, CA) \n", - "107374 bachelors_degree 1 (Tract 101.01, San Francisco, CA) \n", - "102026 some_college 1 (Tract 6133, San Mateo, CA) \n", - "16433 bachelors_degree 1 (Tract 615.01, San Francisco, CA) \n", - "245251 some_college 2 (Tract 177, San Francisco, CA) \n", + " work_bgrp_2020 \\\n", + "183579 Does not have work/school location \n", "\n", " wfh home_cty_2020 \\\n", - "49193 unemployed_under_16_not_in_labor_force Alameda \n", - "107374 in_person Alameda \n", - "102026 remote San Mateo \n", - "16433 in_person Alameda \n", - "245251 employed_not_working Contra Costa \n", + "183579 unemployed_under_16_not_in_labor_force San Joaquin \n", "\n", - " home_trct_2020 tenure industry \\\n", - "49193 4228 (Alameda, CA) GQ naics72 \n", - "107374 4041.01 (Alameda, CA) renter naics445299 \n", - "102026 6133 (San Mateo, CA) owner naics81 \n", - "16433 4010 (Alameda, CA) owner naics6214 \n", - "245251 3382.04 (Contra Costa, CA) owner naics451110 \n", + " home_trct_2020 tenure industry \\\n", + "183579 41.04 (San Joaquin, CA) owner not_working \n", "\n", - " work_trct_2020 school_grade_attending building_type \\\n", - "49193 9820 (Alameda, CA) undergraduate GQ_structure \n", - "107374 101.01 (San Francisco, CA) not_attending_school multiple_units \n", - "102026 6133 (San Mateo, CA) undergraduate single_family \n", - "16433 615.01 (San Francisco, CA) not_attending_school several_units \n", - "245251 177 (San Francisco, CA) undergraduate single_family \n", + " work_trct_2020 school_grade_attending \\\n", + "183579 Does not have work/school location not_attending_school \n", "\n", - " commute_mode employment_status work_cty_2020 \\\n", - "49193 other_travel_mode not_in_labor_force Alameda \n", - "107374 private_auto employed San Francisco \n", - "102026 worked_from_home employed San Mateo \n", - "16433 auto_passenger employed San Francisco \n", - "245251 public_transit employed San Francisco \n", + " building_type commute_mode employment_status \\\n", + "183579 single_family other_travel_mode not_in_labor_force \n", "\n", - " individual_income home_st_2020 sex household_size \\\n", - "49193 0.0 California male 1.0 \n", - "107374 21861.0 California female 2.0 \n", - "102026 10711.0 California male 6.0 \n", - "16433 52528.0 California female 12.0 \n", - "245251 8744.0 California female 4.0 \n", + " work_cty_2020 individual_income home_st_2020 \\\n", + "183579 Does not have work/school location 12629.0 California \n", "\n", - " home_bgrp_2020 household_id age \n", - "49193 1 (Tract 4228, Alameda, CA) 13526119813432325617 19.0 \n", - "107374 1 (Tract 4041.01, Alameda, CA) 9400661008842675581 31.0 \n", - "102026 1 (Tract 6133, San Mateo, CA) 1316252144924345956 22.0 \n", - "16433 2 (Tract 4010, Alameda, CA) 8580484783011523505 27.0 \n", - "245251 2 (Tract 3382.04, Contra Costa, CA) 16409011573581227320 20.0 " + " sex household_size home_bgrp_2020 \\\n", + "183579 female 3.0 2 (Tract 41.04, San Joaquin, CA) \n", + "\n", + " household_id age \n", + "183579 5519997059193984488 58.0 " ] }, - "execution_count": 92, + "execution_count": 134, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "r_ppl.sample(5)" + "r_ppl.sample()" ] }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 145, + "id": "d2a1647f-ed67-4c33-a089-b72375323a7d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Number of Travelers by Resident Type: Replica People Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Number of Travelers by Resident Type: Replica People Data

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 97, "id": "570daf6d-06b8-46e5-9664-a71c5a093073", "metadata": {}, "outputs": [ @@ -14217,7 +3861,7 @@ "1 visitor 23034" ] }, - "execution_count": 93, + "execution_count": 97, "metadata": {}, "output_type": "execute_result" } @@ -14228,10 +3872,124 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 146, + "id": "1483249f-602c-4805-bcc4-d55e018022ad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Number of Travelers by Resident Type: Replica Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Number of Travelers by Resident Type: Replica Trips Data

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 147, + "id": "5c1894f0-bd42-4014-89d4-6e8d43809319", + "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", + "
trip_taker_resident_type_unique_ids
0core282789
1visitor26806
2NaN1
\n", + "
" + ], + "text/plain": [ + " trip_taker_resident_type _unique_ids\n", + "0 core 282789\n", + "1 visitor 26806\n", + "2 NaN 1" + ] + }, + "execution_count": 147, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>group_by(_.trip_taker_resident_type)>>summarize(_unique_ids = _.trip_taker_person_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 153, "id": "2f4b67bf-78ab-4aa8-bbb0-e382a8f78c9a", "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + "

Traveler Demographics: Replica People Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Fitered for Core Residents" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "text/html": [ @@ -14410,12 +4168,14 @@ "13 worked_from_home male 18621 253921.717631 137849.973686 41.092208" ] }, - "execution_count": 94, + "execution_count": 153, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "display(HTML(\"

Traveler Demographics: Replica People Data

\")) \n", + "display(HTML(\"Fitered for Core Residents\")) \n", "(r_ppl\n", " >>filter(_.home_bgrp_2020!=\"Visitor (no home location)\")\n", " >>group_by(_.commute_mode, _.sex)\n", @@ -14429,10 +4189,42 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": null, + "id": "b0891b62-c968-4ea0-bd9b-753d299a5054", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 152, "id": "2e4bd058-9c4d-4989-a5fc-db6cf6130bf2", "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + "

Traveler Demographics: Replica Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Fitered for Core Residents" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "text/html": [ @@ -14572,12 +4364,14 @@ "8 38.312382 " ] }, - "execution_count": 95, + "execution_count": 152, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "display(HTML(\"

Traveler Demographics: Replica Trips Data

\")) \n", + "display(HTML(\"Fitered for Core Residents\")) \n", "(r_trips\n", " >>filter(_.trip_taker_home_bgrp_2020!=\"Visitor (no home location)\")\n", " >>group_by(_.primary_mode, _.trip_taker_sex)\n", @@ -14592,332 +4386,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 156, "id": "7b637cdd-9560-4d31-bfeb-bffa6cbb55d2", "metadata": {}, "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7f7c1066-c820-43d3-a68e-0dcdfc1dcdce", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "97f56b20-f299-43f5-bad4-2a42362962e2", - "metadata": {}, - "source": [ - "### Read in Streetlight Data: 2022" - ] - }, - { - "cell_type": "code", - "execution_count": 96, - "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", - "metadata": {}, - "outputs": [], - "source": [ - "streetlight = \"streetlight_bay_bridge_corridor_study_corridor_study.csv\"" - ] - }, - { - "cell_type": "code", - "execution_count": 97, - "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", - "metadata": {}, - "outputs": [], - "source": [ - "sl_data = to_snakecase(pd.read_csv(f\"{GCS_PATH}{streetlight}\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 98, - "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", - "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", - "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
134Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1020456908San Francisco – Oakland Bay Bridge / 23874736 / 1Motorway0.077yes221WESTno1: Weekday (M-F)14: Mid-Day (10am-4pm)4840152568.7473719.291.33True67
453Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1050419851San Francisco – Oakland Bay Bridge / 179235221 / 1Motorway0.004yes38EASTno0: All Days (M-Su)03: 1am (1am-2am)172666267.8407.441.03False75
1572Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1133975975San Francisco – Oakland Bay Bridge / 929579737 / 1Motorway0.273yes215WESTno1: Weekday (M-F)12: 9am (9am-10am)8910383068.6342436.351.83True59
472Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1050419851San Francisco – Oakland Bay Bridge / 179235221 / 1Motorway0.004yes38EASTno0: All Days (M-Su)22: 5pm (5pm-6pm)1039342267.84044.831.62True57
1534Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1133975975San Francisco – Oakland Bay Bridge / 929579737 / 1Motorway0.273yes215WESTno0: All Days (M-Su)04: 2am (2am-3am)855681468.634233.791.01False75
\n", - "
" - ], - "text/plain": [ - " data_periods \\\n", - "134 Jan 01, 2022 - Dec 31, 2022 \n", - "453 Jan 01, 2022 - Dec 31, 2022 \n", - "1572 Jan 01, 2022 - Dec 31, 2022 \n", - "472 Jan 01, 2022 - Dec 31, 2022 \n", - "1534 Jan 01, 2022 - Dec 31, 2022 \n", - "\n", - " mode_of_travel zone_id \\\n", - "134 All Vehicles CVD Plus - StL All Vehicles Volume 1020456908 \n", - "453 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", - "1572 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", - "472 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", - "1534 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", - "\n", - " zone_name road_classification \\\n", - "134 San Francisco – Oakland Bay Bridge / 23874736 / 1 Motorway \n", - "453 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", - "1572 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", - "472 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", - "1534 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", - "\n", - " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "134 0.077 yes 221 \n", - "453 0.004 yes 38 \n", - "1572 0.273 yes 215 \n", - "472 0.004 yes 38 \n", - "1534 0.273 yes 215 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "134 WEST no 1: Weekday (M-F) \n", - "453 EAST no 0: All Days (M-Su) \n", - "1572 WEST no 1: Weekday (M-F) \n", - "472 EAST no 0: All Days (M-Su) \n", - "1534 WEST no 0: All Days (M-Su) \n", - "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "134 14: Mid-Day (10am-4pm) 48401 \n", - "453 03: 1am (1am-2am) 1726 \n", - "1572 12: 9am (9am-10am) 8910 \n", - "472 22: 5pm (5pm-6pm) 10393 \n", - "1534 04: 2am (2am-3am) 855 \n", - "\n", - " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "134 52 5 \n", - "453 66 2 \n", - "1572 38 30 \n", - "472 42 2 \n", - "1534 68 14 \n", - "\n", - " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "134 68.747 3719.29 \n", - "453 67.840 7.44 \n", - "1572 68.634 2436.35 \n", - "472 67.840 44.83 \n", - "1534 68.634 233.79 \n", - "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "134 1.33 True 67 \n", - "453 1.03 False 75 \n", - "1572 1.83 True 59 \n", - "472 1.62 True 57 \n", - "1534 1.01 False 75 " - ] - }, - "execution_count": 98, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sl_data.sample(5)" - ] - }, - { - "cell_type": "markdown", - "id": "3a3d1c17-1d5b-4ddf-aac3-78b8156ceca4", - "metadata": {}, - "source": [ - "#### Data Explorations: Streetlight" - ] - }, - { - "cell_type": "code", - "execution_count": 99, - "id": "da10c3eb-31bd-437e-b546-82472d66f964", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "1710" - ] - }, - "execution_count": 99, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "len(sl_data)" + "replica_people_demographics = (r_ppl\n", + " >>group_by(_.commute_mode, _.sex)\n", + " >>summarize(\n", + " n_ppl = _.person_id.nunique(),\n", + " avg_h_income = _.household_income.mean(),\n", + " avg_p_income = _.individual_income.mean(),\n", + " avg_age = _.age.mean())\n", + ")" ] }, { "cell_type": "code", - "execution_count": 100, - "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", + "execution_count": 157, + "id": "bcaa0855-faf6-4eb0-aa8e-48cb3348baeb", "metadata": {}, "outputs": [ { @@ -14941,166 +4428,346 @@ " \n", " \n", " \n", - " zone_id\n", - " zone_name\n", - " n\n", + " commute_mode\n", + " sex\n", + " n_ppl\n", + " avg_h_income\n", + " avg_p_income\n", + " avg_age\n", " \n", " \n", " \n", " \n", " 0\n", - " 1005898592\n", - " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", - " 90\n", + " auto_passenger\n", + " female\n", + " 10908\n", + " 175717.982765\n", + " 70255.626054\n", + " 42.234507\n", " \n", " \n", " 1\n", - " 1020456908\n", - " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", - " 90\n", + " auto_passenger\n", + " male\n", + " 11605\n", + " 177241.394916\n", + " 82072.291685\n", + " 42.185523\n", " \n", " \n", " 2\n", - " 1022959400\n", - " San Francisco – Oakland Bay Bridge / 661905446 / 1\n", - " 90\n", + " biking\n", + " female\n", + " 234\n", + " 248565.141026\n", + " 82592.418803\n", + " 36.085470\n", " \n", " \n", " 3\n", - " 1032819756\n", - " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", - " 90\n", + " biking\n", + " male\n", + " 527\n", + " 219563.083491\n", + " 120152.859583\n", + " 38.426945\n", " \n", " \n", " 4\n", - " 1036056766\n", - " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", - " 90\n", + " other_travel_mode\n", + " female\n", + " 36176\n", + " 126129.721003\n", + " 21413.682939\n", + " 55.161599\n", " \n", " \n", " 5\n", - " 1050419851\n", - " San Francisco – Oakland Bay Bridge / 179235221 / 1\n", - " 90\n", + " other_travel_mode\n", + " male\n", + " 26290\n", + " 116775.549106\n", + " 33563.078813\n", + " 54.328262\n", " \n", " \n", " 6\n", - " 1093181568\n", - " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", - " 90\n", + " private_auto\n", + " female\n", + " 45312\n", + " 186499.659406\n", + " 76492.005341\n", + " 42.626302\n", " \n", " \n", " 7\n", - " 1112052563\n", - " San Francisco – Oakland Bay Bridge / 236348360 / 1\n", - " 90\n", + " private_auto\n", + " male\n", + " 59762\n", + " 190643.201265\n", + " 100712.386918\n", + " 42.872093\n", " \n", " \n", " 8\n", - " 1112062603\n", - " San Francisco – Oakland Bay Bridge / 236348361 / 1\n", - " 90\n", + " public_transit\n", + " female\n", + " 22008\n", + " 193540.921347\n", + " 84074.072110\n", + " 41.921937\n", " \n", " \n", " 9\n", - " 1114495634\n", - " I 80 / 395419317 / 1\n", - " 90\n", + " public_transit\n", + " male\n", + " 26480\n", + " 207838.001699\n", + " 125445.942485\n", + " 42.259290\n", " \n", " \n", " 10\n", - " 1117259749\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 2\n", - " 90\n", + " walking\n", + " female\n", + " 1332\n", + " 160144.725976\n", + " 63737.956456\n", + " 38.041291\n", " \n", " \n", " 11\n", - " 1118036302\n", - " I 80 / 839972875 / 1\n", - " 90\n", + " walking\n", + " male\n", + " 1494\n", + " 177570.705489\n", + " 100413.455154\n", + " 37.495315\n", " \n", " \n", " 12\n", - " 1120995048\n", - " San Francisco – Oakland Bay Bridge / 497579295 / 1\n", - " 90\n", + " worked_from_home\n", + " female\n", + " 17409\n", + " 226232.999655\n", + " 97016.438853\n", + " 41.219829\n", " \n", " \n", " 13\n", - " 1125811810\n", - " I 80 / 839972874 / 1\n", - " 90\n", + " worked_from_home\n", + " male\n", + " 18621\n", + " 253921.717631\n", + " 137849.973686\n", + " 41.092208\n", " \n", " \n", " 14\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 1\n", - " 90\n", - " \n", - " \n", - " 15\n", - " 1130705657\n", - " San Francisco – Oakland Bay Bridge / 52527662 / 1\n", - " 90\n", - " \n", - " \n", - " 16\n", - " 1132861884\n", - " I 80 / 236348365 / 1\n", - " 90\n", - " \n", - " \n", - " 17\n", - " 1133975975\n", - " San Francisco – Oakland Bay Bridge / 929579737 / 1\n", - " 90\n", - " \n", - " \n", - " 18\n", - " 1135393455\n", - " I 80 / 781148922 / 1\n", - " 90\n", + " NaN\n", + " NaN\n", + " 23034\n", + " NaN\n", + " NaN\n", + " NaN\n", " \n", " \n", "\n", "" ], "text/plain": [ - " zone_id zone_name n\n", - "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 90\n", - "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 90\n", - "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446 / 1 90\n", - "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 90\n", - "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 90\n", - "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221 / 1 90\n", - "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 90\n", - "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360 / 1 90\n", - "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361 / 1 90\n", - "9 1114495634 I 80 / 395419317 / 1 90\n", - "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428 / 2 90\n", - "11 1118036302 I 80 / 839972875 / 1 90\n", - "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295 / 1 90\n", - "13 1125811810 I 80 / 839972874 / 1 90\n", - "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428 / 1 90\n", - "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 90\n", - "16 1132861884 I 80 / 236348365 / 1 90\n", - "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737 / 1 90\n", - "18 1135393455 I 80 / 781148922 / 1 90" + " commute_mode sex n_ppl avg_h_income avg_p_income avg_age\n", + "0 auto_passenger female 10908 175717.982765 70255.626054 42.234507\n", + "1 auto_passenger male 11605 177241.394916 82072.291685 42.185523\n", + "2 biking female 234 248565.141026 82592.418803 36.085470\n", + "3 biking male 527 219563.083491 120152.859583 38.426945\n", + "4 other_travel_mode female 36176 126129.721003 21413.682939 55.161599\n", + "5 other_travel_mode male 26290 116775.549106 33563.078813 54.328262\n", + "6 private_auto female 45312 186499.659406 76492.005341 42.626302\n", + "7 private_auto male 59762 190643.201265 100712.386918 42.872093\n", + "8 public_transit female 22008 193540.921347 84074.072110 41.921937\n", + "9 public_transit male 26480 207838.001699 125445.942485 42.259290\n", + "10 walking female 1332 160144.725976 63737.956456 38.041291\n", + "11 walking male 1494 177570.705489 100413.455154 37.495315\n", + "12 worked_from_home female 17409 226232.999655 97016.438853 41.219829\n", + "13 worked_from_home male 18621 253921.717631 137849.973686 41.092208\n", + "14 NaN NaN 23034 NaN NaN NaN" + ] + }, + "execution_count": 157, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "replica_people_demographics" + ] + }, + { + "cell_type": "code", + "execution_count": 175, + "id": "7f7c1066-c820-43d3-a68e-0dcdfc1dcdce", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 175, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(replica_people_demographics)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"commute_mode\", title = \"Mode\"),\n", + " y=alt.Y(\"n_ppl\", title = \"Number of People\"),\n", + " color=alt.Color(\"commute_mode\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)),\n", + " tooltip=replica_people_demographics.columns.tolist())\n", + " .properties(title = \"Trips by Resident Type\",\n", + " width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "97f56b20-f299-43f5-bad4-2a42362962e2", + "metadata": {}, + "source": [ + "### Read in Streetlight Data: 2022" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "id": "6f3cf136-7531-4b62-b050-169b7bd1c4ec", + "metadata": {}, + "outputs": [], + "source": [ + "streetlight = \"streetlight_bay_bridge_corridor_study_corridor_study.csv\"" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "id": "47943ff0-2949-409b-a9ad-ca5efea3b52d", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data = to_snakecase(pd.read_csv(f\"{GCS_PATH}{streetlight}\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "id": "28fc95f8-5898-486f-81f3-f0ac7885431c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Streetlight Data Sample

" + ], + "text/plain": [ + "" ] }, - "execution_count": 100, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ - "sl_data>>count(_.zone_id, _.zone_name)" + "display(HTML(\"

Streetlight Data Sample

\")) \n" ] }, { "cell_type": "code", - "execution_count": 101, - "id": "cd1ce590-2019-43f0-ba09-786520479ad8", + "execution_count": 137, + "id": "3398c3fa-856d-49a0-8d2d-7994f3f50df1", "metadata": {}, "outputs": [ { @@ -15124,251 +4791,151 @@ " \n", " \n", " \n", + " data_periods\n", + " mode_of_travel\n", + " zone_id\n", + " zone_name\n", + " road_classification\n", + " line_zone_length__miles_\n", + " zone_is_pass_through\n", + " zone_direction__degrees_\n", + " zone_cardinal_direction\n", + " zone_is_bi_direction\n", + " day_type\n", " day_part\n", - " n\n", + " average_daily_segment_traffic__stl_volume_\n", + " avg_segment_speed__mph_\n", + " avg_segment_travel_time__sec_\n", + " free_flow_speed__mph_\n", + " vehicle_miles_of_travel__stl_volume_\n", + " travel_time_index\n", + " congested_segment\n", + " _85th_speed_percentile\n", " \n", " \n", " \n", " \n", - " 0\n", - " 00: All Day (12am-12am)\n", - " 3\n", - " \n", - " \n", - " 1\n", - " 01: 12am (12am-1am)\n", - " 3\n", - " \n", - " \n", - " 2\n", - " 02: Early AM (12am-6am)\n", - " 3\n", - " \n", - " \n", - " 3\n", - " 03: 1am (1am-2am)\n", - " 3\n", - " \n", - " \n", - " 4\n", - " 04: 2am (2am-3am)\n", - " 3\n", - " \n", - " \n", - " 5\n", - " 05: 3am (3am-4am)\n", - " 3\n", - " \n", - " \n", - " 6\n", + " 876\n", + " Jan 01, 2022 - Dec 31, 2022\n", + " All Vehicles CVD Plus - StL All Vehicles Volume\n", + " 1114495634\n", + " I 80 / 395419317 / 1\n", + " Motorway\n", + " 0.213\n", + " yes\n", + " 82\n", + " EAST\n", + " no\n", + " 2: Weekend Day (Sa-Su)\n", " 06: 4am (4am-5am)\n", - " 3\n", - " \n", - " \n", - " 7\n", - " 07: 5am (5am-6am)\n", - " 3\n", - " \n", - " \n", - " 8\n", - " 08: 6am (6am-7am)\n", - " 3\n", - " \n", - " \n", - " 9\n", - " 09: Peak AM (6am-10am)\n", - " 3\n", - " \n", - " \n", - " 10\n", - " 10: 7am (7am-8am)\n", - " 3\n", - " \n", - " \n", - " 11\n", - " 11: 8am (8am-9am)\n", - " 3\n", - " \n", - " \n", - " 12\n", - " 12: 9am (9am-10am)\n", - " 3\n", - " \n", - " \n", - " 13\n", - " 13: 10am (10am-11am)\n", - " 3\n", - " \n", - " \n", - " 14\n", - " 14: Mid-Day (10am-4pm)\n", - " 3\n", - " \n", - " \n", - " 15\n", - " 15: 11am (11am-12noon)\n", - " 3\n", - " \n", - " \n", - " 16\n", - " 16: 12pm (12noon-1pm)\n", - " 3\n", - " \n", - " \n", - " 17\n", - " 17: 1pm (1pm-2pm)\n", - " 3\n", - " \n", - " \n", - " 18\n", - " 18: 2pm (2pm-3pm)\n", - " 3\n", - " \n", - " \n", - " 19\n", - " 19: 3pm (3pm-4pm)\n", - " 3\n", - " \n", - " \n", - " 20\n", - " 20: 4pm (4pm-5pm)\n", - " 3\n", - " \n", - " \n", - " 21\n", - " 21: Peak PM (4pm-8pm)\n", - " 3\n", - " \n", - " \n", - " 22\n", - " 22: 5pm (5pm-6pm)\n", - " 3\n", - " \n", - " \n", - " 23\n", - " 23: 6pm (6pm-7pm)\n", - " 3\n", - " \n", - " \n", - " 24\n", - " 24: 7pm (7pm-8pm)\n", - " 3\n", - " \n", - " \n", - " 25\n", - " 25: 8pm (8pm-9pm)\n", - " 3\n", - " \n", - " \n", - " 26\n", - " 26: Late PM (8pm-12am)\n", - " 3\n", - " \n", - " \n", - " 27\n", - " 27: 9pm (9pm-10pm)\n", - " 3\n", - " \n", - " \n", - " 28\n", - " 28: 10pm (10pm-11pm)\n", - " 3\n", - " \n", - " \n", - " 29\n", - " 29: 11pm (11pm-12am)\n", - " 3\n", + " 864\n", + " 68\n", + " 11\n", + " 69.063\n", + " 184.44\n", + " 1.01\n", + " False\n", + " 75\n", " \n", " \n", "\n", "" ], "text/plain": [ - " day_part n\n", - "0 00: All Day (12am-12am) 3\n", - "1 01: 12am (12am-1am) 3\n", - "2 02: Early AM (12am-6am) 3\n", - "3 03: 1am (1am-2am) 3\n", - "4 04: 2am (2am-3am) 3\n", - "5 05: 3am (3am-4am) 3\n", - "6 06: 4am (4am-5am) 3\n", - "7 07: 5am (5am-6am) 3\n", - "8 08: 6am (6am-7am) 3\n", - "9 09: Peak AM (6am-10am) 3\n", - "10 10: 7am (7am-8am) 3\n", - "11 11: 8am (8am-9am) 3\n", - "12 12: 9am (9am-10am) 3\n", - "13 13: 10am (10am-11am) 3\n", - "14 14: Mid-Day (10am-4pm) 3\n", - "15 15: 11am (11am-12noon) 3\n", - "16 16: 12pm (12noon-1pm) 3\n", - "17 17: 1pm (1pm-2pm) 3\n", - "18 18: 2pm (2pm-3pm) 3\n", - "19 19: 3pm (3pm-4pm) 3\n", - "20 20: 4pm (4pm-5pm) 3\n", - "21 21: Peak PM (4pm-8pm) 3\n", - "22 22: 5pm (5pm-6pm) 3\n", - "23 23: 6pm (6pm-7pm) 3\n", - "24 24: 7pm (7pm-8pm) 3\n", - "25 25: 8pm (8pm-9pm) 3\n", - "26 26: Late PM (8pm-12am) 3\n", - "27 27: 9pm (9pm-10pm) 3\n", - "28 28: 10pm (10pm-11pm) 3\n", - "29 29: 11pm (11pm-12am) 3" + " data_periods \\\n", + "876 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "876 All Vehicles CVD Plus - StL All Vehicles Volume 1114495634 \n", + "\n", + " zone_name road_classification line_zone_length__miles_ \\\n", + "876 I 80 / 395419317 / 1 Motorway 0.213 \n", + "\n", + " zone_is_pass_through zone_direction__degrees_ zone_cardinal_direction \\\n", + "876 yes 82 EAST \n", + "\n", + " zone_is_bi_direction day_type day_part \\\n", + "876 no 2: Weekend Day (Sa-Su) 06: 4am (4am-5am) \n", + "\n", + " average_daily_segment_traffic__stl_volume_ avg_segment_speed__mph_ \\\n", + "876 864 68 \n", + "\n", + " avg_segment_travel_time__sec_ free_flow_speed__mph_ \\\n", + "876 11 69.063 \n", + "\n", + " vehicle_miles_of_travel__stl_volume_ travel_time_index \\\n", + "876 184.44 1.01 \n", + "\n", + " congested_segment _85th_speed_percentile \n", + "876 False 75 " ] }, - "execution_count": 101, + "execution_count": 137, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "sl_data>>filter(_.zone_id==1133975975)>>count(_.day_part)" + "sl_data.sample()" ] }, { "cell_type": "markdown", - "id": "5d362f46-cfe6-4d13-b3ea-67f491a66897", - "metadata": {}, - "source": [ - "* The data here shows that each segment is broken out into hour time slots and then also aggregated to peak time periods. moving forward we will look at the `All Day` for `day_part` and `All Days` for `day_type`" - ] - }, - { - "cell_type": "code", - "execution_count": 102, - "id": "57c890a6-c667-4917-a090-b85f1aadcad7", + "id": "3a3d1c17-1d5b-4ddf-aac3-78b8156ceca4", "metadata": {}, - "outputs": [], "source": [ - "sl_data_single_day = sl_data>>filter(_.day_part == '00: All Day (12am-12am)', _.day_type == '0: All Days (M-Su)')" + "#### Data Explorations: Streetlight" ] }, { "cell_type": "code", - "execution_count": 103, - "id": "0a059c82-c7c8-43b9-92a6-178b42101828", + "execution_count": 177, + "id": "da10c3eb-31bd-437e-b546-82472d66f964", "metadata": {}, "outputs": [ + { + "data": { + "text/html": [ + "Length of the Streetlight Data" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "text/plain": [ - "19" + "1710" ] }, - "execution_count": 103, + "execution_count": 177, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "len(sl_data_single_day)" + "display(HTML(\"Length of the Streetlight Data\")) \n", + "\n", + "len(sl_data)" ] }, { "cell_type": "code", - "execution_count": 104, - "id": "67213733-9905-42bd-912e-cf943cd66b40", + "execution_count": 174, + "id": "5e403ce9-33bc-4453-9323-df46fad1f38a", + "metadata": {}, + "outputs": [], + "source": [ + "# sl_data>>count(_.zone_id, _.zone_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "id": "cd1ce590-2019-43f0-ba09-786520479ad8", "metadata": {}, "outputs": [ { @@ -15392,266 +4959,197 @@ " \n", " \n", " \n", - " zone_id\n", - " zone_name\n", + " day_part\n", " n\n", " \n", " \n", " \n", " \n", " 0\n", - " 1005898592\n", - " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", - " 1\n", + " 00: All Day (12am-12am)\n", + " 3\n", " \n", " \n", " 1\n", - " 1020456908\n", - " San Francisco – Oakland Bay Bridge / 23874736 / 1\n", - " 1\n", + " 01: 12am (12am-1am)\n", + " 3\n", " \n", " \n", " 2\n", - " 1022959400\n", - " San Francisco – Oakland Bay Bridge / 661905446 / 1\n", - " 1\n", + " 02: Early AM (12am-6am)\n", + " 3\n", " \n", " \n", " 3\n", - " 1032819756\n", - " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", - " 1\n", + " 03: 1am (1am-2am)\n", + " 3\n", " \n", " \n", " 4\n", - " 1036056766\n", - " San Francisco – Oakland Bay Bridge / 52721870 / 1\n", - " 1\n", + " 04: 2am (2am-3am)\n", + " 3\n", " \n", " \n", " 5\n", - " 1050419851\n", - " San Francisco – Oakland Bay Bridge / 179235221 / 1\n", - " 1\n", + " 05: 3am (3am-4am)\n", + " 3\n", " \n", " \n", " 6\n", - " 1093181568\n", - " San Francisco – Oakland Bay Bridge / 50691047 / 1\n", - " 1\n", + " 06: 4am (4am-5am)\n", + " 3\n", " \n", " \n", " 7\n", - " 1112052563\n", - " San Francisco – Oakland Bay Bridge / 236348360 / 1\n", - " 1\n", + " 07: 5am (5am-6am)\n", + " 3\n", " \n", " \n", " 8\n", - " 1112062603\n", - " San Francisco – Oakland Bay Bridge / 236348361 / 1\n", - " 1\n", + " 08: 6am (6am-7am)\n", + " 3\n", " \n", " \n", " 9\n", - " 1114495634\n", - " I 80 / 395419317 / 1\n", - " 1\n", + " 09: Peak AM (6am-10am)\n", + " 3\n", " \n", " \n", " 10\n", - " 1117259749\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 2\n", - " 1\n", + " 10: 7am (7am-8am)\n", + " 3\n", " \n", " \n", " 11\n", - " 1118036302\n", - " I 80 / 839972875 / 1\n", - " 1\n", + " 11: 8am (8am-9am)\n", + " 3\n", " \n", " \n", " 12\n", - " 1120995048\n", - " San Francisco – Oakland Bay Bridge / 497579295 / 1\n", - " 1\n", + " 12: 9am (9am-10am)\n", + " 3\n", " \n", " \n", " 13\n", - " 1125811810\n", - " I 80 / 839972874 / 1\n", - " 1\n", + " 13: 10am (10am-11am)\n", + " 3\n", " \n", " \n", " 14\n", - " 1128174334\n", - " San Francisco – Oakland Bay Bridge / 237731428 / 1\n", - " 1\n", + " 14: Mid-Day (10am-4pm)\n", + " 3\n", " \n", " \n", " 15\n", - " 1130705657\n", - " San Francisco – Oakland Bay Bridge / 52527662 / 1\n", - " 1\n", + " 15: 11am (11am-12noon)\n", + " 3\n", " \n", " \n", " 16\n", - " 1132861884\n", - " I 80 / 236348365 / 1\n", - " 1\n", + " 16: 12pm (12noon-1pm)\n", + " 3\n", " \n", " \n", " 17\n", - " 1133975975\n", - " San Francisco – Oakland Bay Bridge / 929579737 / 1\n", - " 1\n", + " 17: 1pm (1pm-2pm)\n", + " 3\n", " \n", " \n", " 18\n", - " 1135393455\n", - " I 80 / 781148922 / 1\n", - " 1\n", + " 18: 2pm (2pm-3pm)\n", + " 3\n", " \n", - " \n", - "\n", - "" - ], - "text/plain": [ - " zone_id zone_name n\n", - "0 1005898592 San Francisco – Oakland Bay Bridge / 8921938 / 1 1\n", - "1 1020456908 San Francisco – Oakland Bay Bridge / 23874736 / 1 1\n", - "2 1022959400 San Francisco – Oakland Bay Bridge / 661905446 / 1 1\n", - "3 1032819756 San Francisco – Oakland Bay Bridge / 11415208 / 1 1\n", - "4 1036056766 San Francisco – Oakland Bay Bridge / 52721870 / 1 1\n", - "5 1050419851 San Francisco – Oakland Bay Bridge / 179235221 / 1 1\n", - "6 1093181568 San Francisco – Oakland Bay Bridge / 50691047 / 1 1\n", - "7 1112052563 San Francisco – Oakland Bay Bridge / 236348360 / 1 1\n", - "8 1112062603 San Francisco – Oakland Bay Bridge / 236348361 / 1 1\n", - "9 1114495634 I 80 / 395419317 / 1 1\n", - "10 1117259749 San Francisco – Oakland Bay Bridge / 237731428 / 2 1\n", - "11 1118036302 I 80 / 839972875 / 1 1\n", - "12 1120995048 San Francisco – Oakland Bay Bridge / 497579295 / 1 1\n", - "13 1125811810 I 80 / 839972874 / 1 1\n", - "14 1128174334 San Francisco – Oakland Bay Bridge / 237731428 / 1 1\n", - "15 1130705657 San Francisco – Oakland Bay Bridge / 52527662 / 1 1\n", - "16 1132861884 I 80 / 236348365 / 1 1\n", - "17 1133975975 San Francisco – Oakland Bay Bridge / 929579737 / 1 1\n", - "18 1135393455 I 80 / 781148922 / 1 1" - ] - }, - "execution_count": 104, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sl_data_single_day>>count(_.zone_id, _.zone_name)" - ] - }, - { - "cell_type": "code", - "execution_count": 105, - "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", - "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", "
data_periodsmode_of_travelzone_idzone_nameroad_classificationline_zone_length__miles_zone_is_pass_throughzone_direction__degrees_zone_cardinal_directionzone_is_bi_directionday_typeday_partaverage_daily_segment_traffic__stl_volume_avg_segment_speed__mph_avg_segment_travel_time__sec_free_flow_speed__mph_vehicle_miles_of_travel__stl_volume_travel_time_indexcongested_segment_85th_speed_percentile
1919: 3pm (3pm-4pm)3
1530Jan 01, 2022 - Dec 31, 2022All Vehicles CVD Plus - StL All Vehicles Volume1133975975San Francisco – Oakland Bay Bridge / 929579737 / 1Motorway0.273yes215WESTno0: All Days (M-Su)00: All Day (12am-12am)128139492368.63435038.31.39True672020: 4pm (4pm-5pm)3
2121: Peak PM (4pm-8pm)3
2222: 5pm (5pm-6pm)3
2323: 6pm (6pm-7pm)3
2424: 7pm (7pm-8pm)3
2525: 8pm (8pm-9pm)3
2626: Late PM (8pm-12am)3
2727: 9pm (9pm-10pm)3
2828: 10pm (10pm-11pm)3
2929: 11pm (11pm-12am)3
\n", "
" ], "text/plain": [ - " data_periods \\\n", - "1530 Jan 01, 2022 - Dec 31, 2022 \n", - "\n", - " mode_of_travel zone_id \\\n", - "1530 All Vehicles CVD Plus - StL All Vehicles Volume 1133975975 \n", - "\n", - " zone_name road_classification \\\n", - "1530 San Francisco – Oakland Bay Bridge / 929579737 / 1 Motorway \n", - "\n", - " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "1530 0.273 yes 215 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "1530 WEST no 0: All Days (M-Su) \n", - "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "1530 00: All Day (12am-12am) 128139 \n", - "\n", - " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "1530 49 23 \n", - "\n", - " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "1530 68.634 35038.3 \n", - "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "1530 1.39 True 67 " + " day_part n\n", + "0 00: All Day (12am-12am) 3\n", + "1 01: 12am (12am-1am) 3\n", + "2 02: Early AM (12am-6am) 3\n", + "3 03: 1am (1am-2am) 3\n", + "4 04: 2am (2am-3am) 3\n", + "5 05: 3am (3am-4am) 3\n", + "6 06: 4am (4am-5am) 3\n", + "7 07: 5am (5am-6am) 3\n", + "8 08: 6am (6am-7am) 3\n", + "9 09: Peak AM (6am-10am) 3\n", + "10 10: 7am (7am-8am) 3\n", + "11 11: 8am (8am-9am) 3\n", + "12 12: 9am (9am-10am) 3\n", + "13 13: 10am (10am-11am) 3\n", + "14 14: Mid-Day (10am-4pm) 3\n", + "15 15: 11am (11am-12noon) 3\n", + "16 16: 12pm (12noon-1pm) 3\n", + "17 17: 1pm (1pm-2pm) 3\n", + "18 18: 2pm (2pm-3pm) 3\n", + "19 19: 3pm (3pm-4pm) 3\n", + "20 20: 4pm (4pm-5pm) 3\n", + "21 21: Peak PM (4pm-8pm) 3\n", + "22 22: 5pm (5pm-6pm) 3\n", + "23 23: 6pm (6pm-7pm) 3\n", + "24 24: 7pm (7pm-8pm) 3\n", + "25 25: 8pm (8pm-9pm) 3\n", + "26 26: Late PM (8pm-12am) 3\n", + "27 27: 9pm (9pm-10pm) 3\n", + "28 28: 10pm (10pm-11pm) 3\n", + "29 29: 11pm (11pm-12am) 3" ] }, "execution_count": 105, @@ -15660,12 +5158,60 @@ } ], "source": [ - "sl_data_single_day>>filter(_.zone_id==1133975975)" + "sl_data>>filter(_.zone_id==1133975975)>>count(_.day_part)" + ] + }, + { + "cell_type": "markdown", + "id": "5d362f46-cfe6-4d13-b3ea-67f491a66897", + "metadata": {}, + "source": [ + "* The data here shows that each segment is broken out into hour time slots and then also aggregated to peak time periods. moving forward we will look at the `All Day` for `day_part` and `All Days` for `day_type`" ] }, { "cell_type": "code", "execution_count": 106, + "id": "57c890a6-c667-4917-a090-b85f1aadcad7", + "metadata": {}, + "outputs": [], + "source": [ + "sl_data_single_day = sl_data>>filter(_.day_part == '00: All Day (12am-12am)', _.day_type == '0: All Days (M-Su)')" + ] + }, + { + "cell_type": "code", + "execution_count": 172, + "id": "0a059c82-c7c8-43b9-92a6-178b42101828", + "metadata": {}, + "outputs": [], + "source": [ + "# len(sl_data_single_day)" + ] + }, + { + "cell_type": "code", + "execution_count": 173, + "id": "67213733-9905-42bd-912e-cf943cd66b40", + "metadata": {}, + "outputs": [], + "source": [ + "# sl_data_single_day>>count(_.zone_id, _.zone_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 171, + "id": "2e497c77-91ef-490f-a288-abe4e2c740dc", + "metadata": {}, + "outputs": [], + "source": [ + "# sl_data_single_day>>filter(_.zone_id==1133975975)" + ] + }, + { + "cell_type": "code", + "execution_count": 110, "id": "28292f62-b2ab-46cb-ac08-b728facdfdc0", "metadata": {}, "outputs": [ @@ -15714,126 +5260,126 @@ " \n", " \n", " \n", - " 180\n", + " 270\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1022959400\n", - " San Francisco – Oakland Bay Bridge / 661905446 / 1\n", + " 1032819756\n", + " San Francisco – Oakland Bay Bridge / 11415208 / 1\n", " Motorway\n", - " 1.939\n", + " 0.109\n", " yes\n", - " 40\n", - " EAST\n", + " 220\n", + " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 131167\n", + " 132245\n", " 49\n", - " 149\n", - " 64.627\n", - " 254292.0\n", - " 1.32\n", + " 10\n", + " 68.596\n", + " 14450.00\n", + " 1.41\n", " True\n", - " 61\n", + " 67\n", " \n", " \n", - " 1440\n", + " 450\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1132861884\n", - " I 80 / 236348365 / 1\n", + " 1050419851\n", + " San Francisco – Oakland Bay Bridge / 179235221 / 1\n", " Motorway\n", - " 0.006\n", + " 0.004\n", " yes\n", - " 85\n", + " 38\n", " EAST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 128581\n", - " 63\n", + " 161170\n", + " 53\n", " 2\n", - " 70.532\n", - " 725.2\n", - " 1.12\n", - " False\n", - " 72\n", + " 67.840\n", + " 695.17\n", + " 1.29\n", + " True\n", + " 67\n", " \n", " \n", - " 1620\n", + " 0\n", " Jan 01, 2022 - Dec 31, 2022\n", " All Vehicles CVD Plus - StL All Vehicles Volume\n", - " 1135393455\n", - " I 80 / 781148922 / 1\n", + " 1005898592\n", + " San Francisco – Oakland Bay Bridge / 8921938 / 1\n", " Motorway\n", - " 0.256\n", + " 1.985\n", " yes\n", - " 265\n", + " 220\n", " WEST\n", " no\n", " 0: All Days (M-Su)\n", " 00: All Day (12am-12am)\n", - " 104573\n", - " 53\n", - " 18\n", - " 67.716\n", - " 26778.5\n", - " 1.28\n", + " 108456\n", + " 44\n", + " 179\n", + " 66.336\n", + " 215328.00\n", + " 1.50\n", " True\n", - " 67\n", + " 63\n", " \n", " \n", "\n", "" ], "text/plain": [ - " data_periods \\\n", - "180 Jan 01, 2022 - Dec 31, 2022 \n", - "1440 Jan 01, 2022 - Dec 31, 2022 \n", - "1620 Jan 01, 2022 - Dec 31, 2022 \n", + " data_periods \\\n", + "270 Jan 01, 2022 - Dec 31, 2022 \n", + "450 Jan 01, 2022 - Dec 31, 2022 \n", + "0 Jan 01, 2022 - Dec 31, 2022 \n", + "\n", + " mode_of_travel zone_id \\\n", + "270 All Vehicles CVD Plus - StL All Vehicles Volume 1032819756 \n", + "450 All Vehicles CVD Plus - StL All Vehicles Volume 1050419851 \n", + "0 All Vehicles CVD Plus - StL All Vehicles Volume 1005898592 \n", + "\n", + " zone_name road_classification \\\n", + "270 San Francisco – Oakland Bay Bridge / 11415208 / 1 Motorway \n", + "450 San Francisco – Oakland Bay Bridge / 179235221 / 1 Motorway \n", + "0 San Francisco – Oakland Bay Bridge / 8921938 / 1 Motorway \n", + "\n", + " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", + "270 0.109 yes 220 \n", + "450 0.004 yes 38 \n", + "0 1.985 yes 220 \n", + "\n", + " zone_cardinal_direction zone_is_bi_direction day_type \\\n", + "270 WEST no 0: All Days (M-Su) \n", + "450 EAST no 0: All Days (M-Su) \n", + "0 WEST no 0: All Days (M-Su) \n", "\n", - " mode_of_travel zone_id \\\n", - "180 All Vehicles CVD Plus - StL All Vehicles Volume 1022959400 \n", - "1440 All Vehicles CVD Plus - StL All Vehicles Volume 1132861884 \n", - "1620 All Vehicles CVD Plus - StL All Vehicles Volume 1135393455 \n", - "\n", - " zone_name road_classification \\\n", - "180 San Francisco – Oakland Bay Bridge / 661905446 / 1 Motorway \n", - "1440 I 80 / 236348365 / 1 Motorway \n", - "1620 I 80 / 781148922 / 1 Motorway \n", - "\n", - " line_zone_length__miles_ zone_is_pass_through zone_direction__degrees_ \\\n", - "180 1.939 yes 40 \n", - "1440 0.006 yes 85 \n", - "1620 0.256 yes 265 \n", - "\n", - " zone_cardinal_direction zone_is_bi_direction day_type \\\n", - "180 EAST no 0: All Days (M-Su) \n", - "1440 EAST no 0: All Days (M-Su) \n", - "1620 WEST no 0: All Days (M-Su) \n", - "\n", - " day_part average_daily_segment_traffic__stl_volume_ \\\n", - "180 00: All Day (12am-12am) 131167 \n", - "1440 00: All Day (12am-12am) 128581 \n", - "1620 00: All Day (12am-12am) 104573 \n", - "\n", - " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", - "180 49 149 \n", - "1440 63 2 \n", - "1620 53 18 \n", - "\n", - " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", - "180 64.627 254292.0 \n", - "1440 70.532 725.2 \n", - "1620 67.716 26778.5 \n", - "\n", - " travel_time_index congested_segment _85th_speed_percentile \n", - "180 1.32 True 61 \n", - "1440 1.12 False 72 \n", - "1620 1.28 True 67 " + " day_part average_daily_segment_traffic__stl_volume_ \\\n", + "270 00: All Day (12am-12am) 132245 \n", + "450 00: All Day (12am-12am) 161170 \n", + "0 00: All Day (12am-12am) 108456 \n", + "\n", + " avg_segment_speed__mph_ avg_segment_travel_time__sec_ \\\n", + "270 49 10 \n", + "450 53 2 \n", + "0 44 179 \n", + "\n", + " free_flow_speed__mph_ vehicle_miles_of_travel__stl_volume_ \\\n", + "270 68.596 14450.00 \n", + "450 67.840 695.17 \n", + "0 66.336 215328.00 \n", + "\n", + " travel_time_index congested_segment _85th_speed_percentile \n", + "270 1.41 True 67 \n", + "450 1.29 True 67 \n", + "0 1.50 True 63 " ] }, - "execution_count": 106, + "execution_count": 110, "metadata": {}, "output_type": "execute_result" } @@ -15844,90 +5390,20 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 170, "id": "14211b7a-38f9-4b55-b669-67fdae44aa80", "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", - "
zone_cardinal_directionday_typeday_partavg_speedavg_travel_timeavg_volumesum_volume
0EAST0: All Days (M-Su)00: All Day (12am-12am)55.90000032.600000139682.3000001396823
1WEST0: All Days (M-Su)00: All Day (12am-12am)50.33333341.777778123029.7777781107268
\n", - "
" - ], - "text/plain": [ - " zone_cardinal_direction day_type day_part \\\n", - "0 EAST 0: All Days (M-Su) 00: All Day (12am-12am) \n", - "1 WEST 0: All Days (M-Su) 00: All Day (12am-12am) \n", - "\n", - " avg_speed avg_travel_time avg_volume sum_volume \n", - "0 55.900000 32.600000 139682.300000 1396823 \n", - "1 50.333333 41.777778 123029.777778 1107268 " - ] - }, - "execution_count": 107, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "sl_data_single_day>>group_by(_.zone_cardinal_direction, _.day_type, _.day_part)>>summarize(avg_speed= _.avg_segment_speed__mph_.mean(),\n", - " avg_travel_time = _.avg_segment_travel_time__sec_.mean(),\n", - " avg_volume = _.average_daily_segment_traffic__stl_volume_.mean(),\n", - " sum_volume = _.average_daily_segment_traffic__stl_volume_.sum())" + "# sl_data_single_day>>group_by(_.zone_cardinal_direction, _.day_type, _.day_part)>>summarize(avg_speed= _.avg_segment_speed__mph_.mean(),\n", + "# avg_travel_time = _.avg_segment_travel_time__sec_.mean(),\n", + "# avg_volume = _.average_daily_segment_traffic__stl_volume_.mean(),\n", + "# sum_volume = _.average_daily_segment_traffic__stl_volume_.sum())" ] }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 112, "id": "778d58f0-25b7-4cf7-b60a-10e773055f48", "metadata": {}, "outputs": [], @@ -15969,7 +5445,7 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 113, "id": "29eab191-4eaa-445c-b444-49048135ef3b", "metadata": {}, "outputs": [], @@ -15991,7 +5467,7 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": 114, "id": "896b63a9-b881-418a-ba40-dbea63f81614", "metadata": {}, "outputs": [], @@ -16005,76 +5481,18 @@ }, { "cell_type": "code", - "execution_count": 111, + "execution_count": 169, "id": "cac29684-36ac-488b-b2d1-044ab5ef86c0", "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", - "
zone_cardinal_directionday_typeday_partavg_speedavg_travel_timeavg_volumesum_volume
5EAST0: All Days (M-Su)26: Late PM (8pm-12am)59.629.523240.7232407
\n", - "
" - ], - "text/plain": [ - " zone_cardinal_direction day_type day_part \\\n", - "5 EAST 0: All Days (M-Su) 26: Late PM (8pm-12am) \n", - "\n", - " avg_speed avg_travel_time avg_volume sum_volume \n", - "5 59.6 29.5 23240.7 232407 " - ] - }, - "execution_count": 111, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "sl_peaks_agg.sample()" + "# sl_peaks_agg.sample()" ] }, { "cell_type": "code", - "execution_count": 112, - "id": "637afffc-560f-4485-985a-d6ee73dd65a7", + "execution_count": 166, + "id": "eedc968c-8306-449a-a2e3-774719d8e256", "metadata": {}, "outputs": [ { @@ -16082,23 +5500,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 112, + "execution_count": 166, "metadata": {}, "output_type": "execute_result" } @@ -16168,7 +5586,7 @@ " ),\n", " tooltip=sl_peaks_agg.columns.tolist(),\n", " )\n", - " .properties(\n", + " .properties(title = \"Average Speed by Direction by Day Part\",\n", " width=800,\n", " height=300)\n", " )\n", @@ -16177,8 +5595,8 @@ }, { "cell_type": "code", - "execution_count": 113, - "id": "2c732efc-ddb0-4a85-83ea-f7667611b973", + "execution_count": 168, + "id": "637afffc-560f-4485-985a-d6ee73dd65a7", "metadata": {}, "outputs": [ { @@ -16186,23 +5604,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 113, + "execution_count": 168, "metadata": {}, "output_type": "execute_result" } @@ -16266,27 +5684,19 @@ " .mark_bar()\n", " .encode(\n", " x=alt.X(\"day_part\"),\n", - " y=alt.Y(\"avg_speed\"),\n", + " y=alt.Y(\"sum_volume\"),\n", " color=alt.Color(\"zone_cardinal_direction\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", " domain=sl_peaks_agg[\"zone_cardinal_direction\"].unique().tolist())\n", " ),\n", " tooltip=sl_peaks_agg.columns.tolist(),\n", " )\n", - " .properties(\n", + " .properties(title = \"Average Volume by Direction by Day Part\",\n", " width=800,\n", " height=300)\n", " )\n", "chart " ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "eedc968c-8306-449a-a2e3-774719d8e256", - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, @@ -16305,7 +5715,7 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 118, "id": "b2eaa07a-2d05-4ed5-a405-a474500a643e", "metadata": {}, "outputs": [], @@ -16319,70 +5729,12 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 161, "id": "1ab3835d-5f8e-4721-9c29-7bd107bad334", "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", - "
zone_cardinal_directionday_typeday_partavg_speedavg_travel_timeavg_volumesum_volume
6EAST0: All Days (M-Su)08: 6am (6am-7am)66.426.13067.030670
\n", - "
" - ], - "text/plain": [ - " zone_cardinal_direction day_type day_part avg_speed \\\n", - "6 EAST 0: All Days (M-Su) 08: 6am (6am-7am) 66.4 \n", - "\n", - " avg_travel_time avg_volume sum_volume \n", - "6 26.1 3067.0 30670 " - ] - }, - "execution_count": 115, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "sl_hourly_agg.sample()" + "# sl_hourly_agg.sample()" ] }, { @@ -16395,7 +5747,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 164, "id": "8cc145e6-b3d9-4b31-9a0d-270431ebf5fb", "metadata": {}, "outputs": [ @@ -16404,23 +5756,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 116, + "execution_count": 164, "metadata": {}, "output_type": "execute_result" } @@ -16490,7 +5842,7 @@ " ),\n", " tooltip=sl_hourly_agg.columns.tolist(),\n", " )\n", - " .properties(\n", + " .properties(title = \"Average Speed by Hour\", \n", " width=800,\n", " height=300)\n", " )\n", @@ -16499,7 +5851,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 167, "id": "b54b867c-d073-4280-bfd3-2fa5bd387016", "metadata": {}, "outputs": [ @@ -16508,23 +5860,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 117, + "execution_count": 167, "metadata": {}, "output_type": "execute_result" } @@ -16594,7 +5946,7 @@ " ),\n", " tooltip=sl_hourly_agg.columns.tolist(),\n", " )\n", - " .properties(\n", + " .properties(title = \"Total Volume by Hour\",\n", " width=800,\n", " height=300)\n", " )\n", From 6c2d87ac48b2472e9ebbdb376ac7eefbf018ea8a Mon Sep 17 00:00:00 2001 From: natam1 Date: Tue, 26 Mar 2024 17:24:33 +0000 Subject: [PATCH 11/16] saving --- .../corridor_study/data_downloads.ipynb | 1339 ++++++++--------- 1 file changed, 662 insertions(+), 677 deletions(-) diff --git a/sb125_analyses/corridor_study/data_downloads.ipynb b/sb125_analyses/corridor_study/data_downloads.ipynb index e358e841a..0b79e337c 100644 --- a/sb125_analyses/corridor_study/data_downloads.ipynb +++ b/sb125_analyses/corridor_study/data_downloads.ipynb @@ -19,7 +19,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_306/4150955979.py:10: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n", + "/tmp/ipykernel_327/4150955979.py:10: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n", " from IPython.core.display import display\n" ] } @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 126, + "execution_count": 129, "id": "b238cf9a-43fa-4ff0-a343-83fa7bf74938", "metadata": {}, "outputs": [], @@ -129,7 +129,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_306/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_327/2643890524.py:1: DtypeWarning: Columns (2,4,5,9,10,11,18,25,26,29,30,35,36,40,43,48,50) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))\n" ] } @@ -244,90 +244,90 @@ " \n", " \n", " \n", - " 344797\n", + " 142645\n", " retail\n", - " 139\n", - " NaN\n", - " 206.05 (Placer, CA)\n", - " \n", - " NaN\n", - " Visitor (no home location)\n", + " 50\n", + " asian_pacific\n", + " 3383.02 (Contra Costa, CA)\n", + " 10438239301001640558\n", + " female\n", + " 3 (Tract 3553.08, Contra Costa, CA)\n", " California\n", - " Visitor (no home location)\n", - " NaN\n", + " California\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", - " visitor\n", + " core\n", " unknown_vehicle_type\n", - " NaN\n", - " 8758582875719778070\n", - " 1 (Tract 9843, San Mateo, CA)\n", - " transportation_utilities\n", - " NaN\n", + " 29.0\n", + " 12590851635069480903\n", + " 2 (Tract 6031, San Mateo, CA)\n", + " non_retail_attraction\n", + " in_person\n", " California\n", " San Mateo\n", - " Visitor (no work/school location)\n", - " 9843 (San Mateo, CA)\n", - " NaN\n", - " 3 (Tract 206.05, Placer, CA)\n", - " NaN\n", - " NaN\n", + " 2 (Tract 6001, San Mateo, CA)\n", + " 6031 (San Mateo, CA)\n", + " 357011.0\n", + " 3 (Tract 3383.02, Contra Costa, CA)\n", " private_auto\n", - " eat\n", - " NaN\n", - " NaN\n", - " Visitor (no work/school location)\n", - " NaN\n", - " Placer\n", - " transportation_utilities\n", - " NaN\n", - " NaN\n", - " unknown_fuel_type\n", - " Visitor (no home location)\n", - " Visitor (no work/school location)\n", - " NaN\n", - " 21:23:00\n", - " NaN\n", + " three_plus\n", + " private_auto\n", + " shop\n", + " single_family\n", " NaN\n", - " region_departure\n", + " California\n", + " 4.0\n", + " Contra Costa\n", + " non_retail_attraction\n", + " naics22\n", + " renter\n", + " other_non_bev\n", + " 3553.08 (Contra Costa, CA)\n", + " 6001 (San Mateo, CA)\n", + " advanced_degree\n", + " 17:58:00\n", + " 136907.0\n", + " employed\n", + " recreation\n", " retail\n", - " Visitor (no work/school location)\n", - " 117.9\n", - " NaN\n", - " Visitor (no home location)\n", - " 6466724364837963852\n", - " 23:42:15\n", + " San Mateo\n", + " 39.4\n", + " not_attending_school\n", + " Contra Costa\n", + " 5618592615102770741\n", + " 18:48:49\n", " \n", " \n", - " 404006\n", - " retail\n", - " 39\n", - " spanish\n", - " 9809 (San Francisco, CA)\n", - " 5717162922661989573\n", + " 457118\n", + " education\n", + " 82\n", + " english\n", + " 227.04 (San Francisco, CA)\n", + " 2595408534468179891\n", " female\n", - " 2 (Tract 2506.01, Solano, CA)\n", + " 1 (Tract 3040.04, Contra Costa, CA)\n", " California\n", " California\n", - " hispanic_or_latino_origin\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 46.0\n", - " 9780660917558834164\n", - " 2 (Tract 2506.01, Solano, CA)\n", + " 26.0\n", + " 13248625291143412823\n", + " 1 (Tract 3040.04, Contra Costa, CA)\n", " single_family\n", " in_person\n", " California\n", - " Solano\n", - " 1 (Tract 9809, San Francisco, CA)\n", - " 2506.01 (Solano, CA)\n", - " 26234.0\n", - " 1 (Tract 9809, San Francisco, CA)\n", + " Contra Costa\n", + " 1 (Tract 227.04, San Francisco, CA)\n", + " 3040.04 (Contra Costa, CA)\n", + " 113292.0\n", + " 1 (Tract 227.04, San Francisco, CA)\n", + " private_auto\n", + " one\n", " private_auto\n", - " two\n", - " auto_passenger\n", " work\n", " single_family\n", " NaN\n", @@ -335,143 +335,143 @@ " 1.0\n", " San Francisco\n", " single_family\n", - " naics44_45\n", - " renter\n", - " unknown_fuel_type\n", - " 2506.01 (Solano, CA)\n", - " 9809 (San Francisco, CA)\n", - " high_school\n", - " 10:15:00\n", - " 26234.0\n", + " naics62\n", + " owner\n", + " other_non_bev\n", + " 3040.04 (Contra Costa, CA)\n", + " 227.04 (San Francisco, CA)\n", + " bachelors_degree\n", + " 13:03:00\n", + " 113292.0\n", " employed\n", - " other_activity_type\n", - " mixed_use\n", + " home\n", + " education\n", " San Francisco\n", - " 30.3\n", + " 61.3\n", " not_attending_school\n", - " Solano\n", - " 17623584878492347501\n", - " 10:54:09\n", + " Contra Costa\n", + " 16118537862818643044\n", + " 14:25:55\n", " \n", " \n", - " 47514\n", - " single_family\n", - " 40\n", - " english\n", - " 4305 (Alameda, CA)\n", - " 9450366543874170043\n", - " female\n", - " 2 (Tract 4305, Alameda, CA)\n", + " 129084\n", + " multi_family\n", + " 44\n", + " spanish\n", + " 208.01 (San Francisco, CA)\n", + " 13701173103356894315\n", + " male\n", + " 2 (Tract 208.01, San Francisco, CA)\n", " California\n", " California\n", - " white_not_hispanic_or_latino\n", + " hispanic_or_latino_origin\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 29.0\n", - " 17995626605244124712\n", - " 2 (Tract 607.01, San Francisco, CA)\n", + " 42.0\n", + " 3062581574704221539\n", + " 1 (Tract 4089, Alameda, CA)\n", " retail\n", " in_person\n", " California\n", - " San Francisco\n", - " 2 (Tract 607.01, San Francisco, CA)\n", - " 607.01 (San Francisco, CA)\n", - " 177915.0\n", - " 2 (Tract 4305, Alameda, CA)\n", - " private_auto\n", - " two\n", + " Alameda\n", + " 1 (Tract 134.02, San Francisco, CA)\n", + " 4089 (Alameda, CA)\n", + " 84168.0\n", + " 2 (Tract 208.01, San Francisco, CA)\n", " private_auto\n", + " zero\n", + " auto_passenger\n", " home\n", - " single_family\n", + " multiple_units\n", " NaN\n", " California\n", " 2.0\n", - " Alameda\n", + " San Francisco\n", " retail\n", - " naics712130\n", - " owner\n", - " other_non_bev\n", - " 4305 (Alameda, CA)\n", - " 607.01 (San Francisco, CA)\n", - " bachelors_degree\n", - " 05:52:00\n", - " 31293.0\n", + " naics62\n", + " renter\n", + " unknown_fuel_type\n", + " 208.01 (San Francisco, CA)\n", + " 134.02 (San Francisco, CA)\n", + " advanced_degree\n", + " 17:03:00\n", + " 43723.0\n", " employed\n", - " work\n", - " single_family\n", + " eat\n", + " multi_family\n", " San Francisco\n", - " 25.3\n", - " not_attending_school\n", - " Alameda\n", - " 6921358500856400741\n", - " 06:32:50\n", + " 20.8\n", + " graduate\n", + " San Francisco\n", + " 3167777576789264988\n", + " 17:47:41\n", " \n", " \n", - " 386134\n", - " retail\n", - " 27\n", - " asian_pacific\n", - " 607.01 (San Francisco, CA)\n", - " 14736001622789934895\n", - " female\n", - " 2 (Tract 4445, Alameda, CA)\n", + " 500586\n", + " single_family\n", + " 37\n", + " english\n", + " 305 (San Francisco, CA)\n", + " 10268453777010421474\n", + " male\n", + " 1 (Tract 604, San Francisco, CA)\n", " California\n", " California\n", - " asian_not_hispanic_or_latino\n", + " white_not_hispanic_or_latino\n", " NaN\n", " NaN\n", " core\n", " unknown_vehicle_type\n", - " 44.0\n", - " 15348858204039127111\n", - " 4 (Tract 4003, Alameda, CA)\n", + " 40.0\n", + " 6541270625886576096\n", + " 2 (Tract 4004, Alameda, CA)\n", " retail\n", " in_person\n", " California\n", " Alameda\n", - " 4 (Tract 4003, Alameda, CA)\n", - " 4003 (Alameda, CA)\n", - " 162728.0\n", - " 3 (Tract 607.01, San Francisco, CA)\n", - " private_auto\n", - " three_plus\n", + " 2 (Tract 305, San Francisco, CA)\n", + " 4004 (Alameda, CA)\n", + " 78984.0\n", + " 2 (Tract 305, San Francisco, CA)\n", " auto_passenger\n", - " shop\n", - " single_family\n", + " two\n", + " auto_passenger\n", + " work\n", + " multiple_units\n", " NaN\n", " California\n", " 4.0\n", " San Francisco\n", " retail\n", - " naics722511\n", - " owner\n", + " not_working\n", + " renter\n", " unknown_fuel_type\n", - " 4445 (Alameda, CA)\n", - " 4003 (Alameda, CA)\n", + " 604 (San Francisco, CA)\n", + " 305 (San Francisco, CA)\n", " high_school\n", - " 10:01:00\n", - " 61795.0\n", + " 08:27:00\n", + " 78984.0\n", " employed\n", - " work\n", - " retail\n", - " Alameda\n", - " 12.2\n", + " shop\n", + " single_family\n", + " San Francisco\n", + " 15.2\n", " not_attending_school\n", - " Alameda\n", - " 9306277843367464539\n", - " 10:28:22\n", + " San Francisco\n", + " 15001617897228539245\n", + " 09:04:20\n", " \n", " \n", - " 318313\n", - " retail\n", - " 43\n", + " 526892\n", + " single_family\n", + " 34\n", " english\n", - " 3451.03 (Contra Costa, CA)\n", - " 10415214486910735210\n", + " 4278 (Alameda, CA)\n", + " 1179592217132771638\n", " male\n", - " 1 (Tract 176.04, San Francisco, CA)\n", + " 5 (Tract 4278, Alameda, CA)\n", " California\n", " California\n", " white_not_hispanic_or_latino\n", @@ -479,44 +479,44 @@ " NaN\n", " core\n", " unknown_vehicle_type\n", - " 67.0\n", - " 1100551162552195990\n", - " 1 (Tract 176.04, San Francisco, CA)\n", - " multi_family\n", - " unemployed_under_16_not_in_labor_force\n", + " 42.0\n", + " 1402835246269671303\n", + " 1 (Tract 227.04, San Francisco, CA)\n", + " industrial\n", + " in_person\n", " California\n", " San Francisco\n", - " Does not have work/school location\n", - " 176.04 (San Francisco, CA)\n", - " 40579.0\n", - " 3 (Tract 3451.03, Contra Costa, CA)\n", - " other_travel_mode\n", - " one\n", - " private_auto\n", - " shop\n", - " multiple_units\n", - " NaN\n", - " Does not have work/school location\n", - " 1.0\n", - " Contra Costa\n", - " multi_family\n", - " naics81\n", - " owner\n", - " other_non_bev\n", - " 176.04 (San Francisco, CA)\n", - " Does not have work/school location\n", - " advanced_degree\n", - " 19:01:06\n", - " 40579.0\n", - " unemployed\n", + " 1 (Tract 227.04, San Francisco, CA)\n", + " 227.04 (San Francisco, CA)\n", + " 163963.0\n", + " 5 (Tract 4278, Alameda, CA)\n", + " public_transit\n", + " two\n", + " auto_passenger\n", " home\n", - " retail\n", - " Does not have work/school location\n", - " 36.9\n", - " not_attending_school\n", + " single_family\n", + " NaN\n", + " California\n", + " 4.0\n", + " Alameda\n", + " mixed_use\n", + " naics31_33\n", + " renter\n", + " unknown_fuel_type\n", + " 4278 (Alameda, CA)\n", + " 227.04 (San Francisco, CA)\n", + " bachelors_degree\n", + " 07:42:00\n", + " 163963.0\n", + " employed\n", + " work\n", + " single_family\n", " San Francisco\n", - " 15574666725470917394\n", - " 19:44:24\n", + " 16.5\n", + " not_attending_school\n", + " Alameda\n", + " 11684344660485501674\n", + " 08:16:54\n", " \n", " \n", "\n", @@ -524,158 +524,144 @@ ], "text/plain": [ " origin_building_use trip_duration_minutes trip_taker_language \\\n", - "344797 retail 139 NaN \n", - "404006 retail 39 spanish \n", - "47514 single_family 40 english \n", - "386134 retail 27 asian_pacific \n", - "318313 retail 43 english \n", + "142645 retail 50 asian_pacific \n", + "457118 education 82 english \n", + "129084 multi_family 44 spanish \n", + "500586 single_family 37 english \n", + "526892 single_family 34 english \n", "\n", " origin_trct_2020 trip_taker_household_id trip_taker_sex \\\n", - "344797 206.05 (Placer, CA) NaN \n", - "404006 9809 (San Francisco, CA) 5717162922661989573 female \n", - "47514 4305 (Alameda, CA) 9450366543874170043 female \n", - "386134 607.01 (San Francisco, CA) 14736001622789934895 female \n", - "318313 3451.03 (Contra Costa, CA) 10415214486910735210 male \n", + "142645 3383.02 (Contra Costa, CA) 10438239301001640558 female \n", + "457118 227.04 (San Francisco, CA) 2595408534468179891 female \n", + "129084 208.01 (San Francisco, CA) 13701173103356894315 male \n", + "500586 305 (San Francisco, CA) 10268453777010421474 male \n", + "526892 4278 (Alameda, CA) 1179592217132771638 male \n", "\n", " trip_taker_home_bgrp_2020 origin_st_2020 \\\n", - "344797 Visitor (no home location) California \n", - "404006 2 (Tract 2506.01, Solano, CA) California \n", - "47514 2 (Tract 4305, Alameda, CA) California \n", - "386134 2 (Tract 4445, Alameda, CA) California \n", - "318313 1 (Tract 176.04, San Francisco, CA) California \n", - "\n", - " trip_taker_home_st_2020 trip_taker_race_ethnicity \\\n", - "344797 Visitor (no home location) NaN \n", - "404006 California hispanic_or_latino_origin \n", - "47514 California white_not_hispanic_or_latino \n", - "386134 California asian_not_hispanic_or_latino \n", - "318313 California white_not_hispanic_or_latino \n", - "\n", - " transit_agency transit_route trip_taker_resident_type \\\n", - "344797 NaN NaN visitor \n", - "404006 NaN NaN core \n", - "47514 NaN NaN core \n", - "386134 NaN NaN core \n", - "318313 NaN NaN core \n", - "\n", - " vehicle_type trip_taker_age activity_id \\\n", - "344797 unknown_vehicle_type NaN 8758582875719778070 \n", - "404006 unknown_vehicle_type 46.0 9780660917558834164 \n", - "47514 unknown_vehicle_type 29.0 17995626605244124712 \n", - "386134 unknown_vehicle_type 44.0 15348858204039127111 \n", - "318313 unknown_vehicle_type 67.0 1100551162552195990 \n", - "\n", - " destination_bgrp_2020 destination_building_use \\\n", - "344797 1 (Tract 9843, San Mateo, CA) transportation_utilities \n", - "404006 2 (Tract 2506.01, Solano, CA) single_family \n", - "47514 2 (Tract 607.01, San Francisco, CA) retail \n", - "386134 4 (Tract 4003, Alameda, CA) retail \n", - "318313 1 (Tract 176.04, San Francisco, CA) multi_family \n", - "\n", - " trip_taker_wfh destination_st_2020 \\\n", - "344797 NaN California \n", - "404006 in_person California \n", - "47514 in_person California \n", - "386134 in_person California \n", - "318313 unemployed_under_16_not_in_labor_force California \n", - "\n", - " destination_cty_2020 trip_taker_work_bgrp_2020 \\\n", - "344797 San Mateo Visitor (no work/school location) \n", - "404006 Solano 1 (Tract 9809, San Francisco, CA) \n", - "47514 San Francisco 2 (Tract 607.01, San Francisco, CA) \n", - "386134 Alameda 4 (Tract 4003, Alameda, CA) \n", - "318313 San Francisco Does not have work/school location \n", - "\n", - " destination_trct_2020 trip_taker_household_income \\\n", - "344797 9843 (San Mateo, CA) NaN \n", - "404006 2506.01 (Solano, CA) 26234.0 \n", - "47514 607.01 (San Francisco, CA) 177915.0 \n", - "386134 4003 (Alameda, CA) 162728.0 \n", - "318313 176.04 (San Francisco, CA) 40579.0 \n", - "\n", - " origin_bgrp_2020 trip_taker_commute_mode \\\n", - "344797 3 (Tract 206.05, Placer, CA) NaN \n", - "404006 1 (Tract 9809, San Francisco, CA) private_auto \n", - "47514 2 (Tract 4305, Alameda, CA) private_auto \n", - "386134 3 (Tract 607.01, San Francisco, CA) private_auto \n", - "318313 3 (Tract 3451.03, Contra Costa, CA) other_travel_mode \n", - "\n", - " trip_taker_available_vehicles primary_mode previous_trip_purpose \\\n", - "344797 NaN private_auto eat \n", - "404006 two auto_passenger work \n", - "47514 two private_auto home \n", - "386134 three_plus auto_passenger shop \n", - "318313 one private_auto shop \n", - "\n", - " trip_taker_building_type transit_submode \\\n", - "344797 NaN NaN \n", - "404006 single_family NaN \n", - "47514 single_family NaN \n", - "386134 single_family NaN \n", - "318313 multiple_units NaN \n", - "\n", - " trip_taker_work_st_2020 trip_taker_household_size \\\n", - "344797 Visitor (no work/school location) NaN \n", - "404006 California 1.0 \n", - "47514 California 2.0 \n", - "386134 California 4.0 \n", - "318313 Does not have work/school location 1.0 \n", - "\n", - " origin_cty_2020 destination_land_use trip_taker_industry \\\n", - "344797 Placer transportation_utilities NaN \n", - "404006 San Francisco single_family naics44_45 \n", - "47514 Alameda retail naics712130 \n", - "386134 San Francisco retail naics722511 \n", - "318313 Contra Costa multi_family naics81 \n", - "\n", - " trip_taker_tenure vehicle_fuel_type trip_taker_home_trct_2020 \\\n", - "344797 NaN unknown_fuel_type Visitor (no home location) \n", - "404006 renter unknown_fuel_type 2506.01 (Solano, CA) \n", - "47514 owner other_non_bev 4305 (Alameda, CA) \n", - "386134 owner unknown_fuel_type 4445 (Alameda, CA) \n", - "318313 owner other_non_bev 176.04 (San Francisco, CA) \n", - "\n", - " trip_taker_work_trct_2020 trip_taker_education \\\n", - "344797 Visitor (no work/school location) NaN \n", - "404006 9809 (San Francisco, CA) high_school \n", - "47514 607.01 (San Francisco, CA) bachelors_degree \n", - "386134 4003 (Alameda, CA) high_school \n", - "318313 Does not have work/school location advanced_degree \n", - "\n", - " trip_start_time trip_taker_individual_income \\\n", - "344797 21:23:00 NaN \n", - "404006 10:15:00 26234.0 \n", - "47514 05:52:00 31293.0 \n", - "386134 10:01:00 61795.0 \n", - "318313 19:01:06 40579.0 \n", - "\n", - " trip_taker_employment_status trip_purpose origin_land_use \\\n", - "344797 NaN region_departure retail \n", - "404006 employed other_activity_type mixed_use \n", - "47514 employed work single_family \n", - "386134 employed work retail \n", - "318313 unemployed home retail \n", - "\n", - " trip_taker_work_cty_2020 trip_distance_miles \\\n", - "344797 Visitor (no work/school location) 117.9 \n", - "404006 San Francisco 30.3 \n", - "47514 San Francisco 25.3 \n", - "386134 Alameda 12.2 \n", - "318313 Does not have work/school location 36.9 \n", - "\n", - " trip_taker_school_grade_attending trip_taker_home_cty_2020 \\\n", - "344797 NaN Visitor (no home location) \n", - "404006 not_attending_school Solano \n", - "47514 not_attending_school Alameda \n", - "386134 not_attending_school Alameda \n", - "318313 not_attending_school San Francisco \n", - "\n", - " trip_taker_person_id trip_end_time \n", - "344797 6466724364837963852 23:42:15 \n", - "404006 17623584878492347501 10:54:09 \n", - "47514 6921358500856400741 06:32:50 \n", - "386134 9306277843367464539 10:28:22 \n", - "318313 15574666725470917394 19:44:24 " + "142645 3 (Tract 3553.08, Contra Costa, CA) California \n", + "457118 1 (Tract 3040.04, Contra Costa, CA) California \n", + "129084 2 (Tract 208.01, San Francisco, CA) California \n", + "500586 1 (Tract 604, San Francisco, CA) California \n", + "526892 5 (Tract 4278, Alameda, CA) California \n", + "\n", + " trip_taker_home_st_2020 trip_taker_race_ethnicity transit_agency \\\n", + "142645 California white_not_hispanic_or_latino NaN \n", + "457118 California white_not_hispanic_or_latino NaN \n", + "129084 California hispanic_or_latino_origin NaN \n", + "500586 California white_not_hispanic_or_latino NaN \n", + "526892 California white_not_hispanic_or_latino NaN \n", + "\n", + " transit_route trip_taker_resident_type vehicle_type \\\n", + "142645 NaN core unknown_vehicle_type \n", + "457118 NaN core unknown_vehicle_type \n", + "129084 NaN core unknown_vehicle_type \n", + "500586 NaN core unknown_vehicle_type \n", + "526892 NaN core unknown_vehicle_type \n", + "\n", + " trip_taker_age activity_id \\\n", + "142645 29.0 12590851635069480903 \n", + "457118 26.0 13248625291143412823 \n", + "129084 42.0 3062581574704221539 \n", + "500586 40.0 6541270625886576096 \n", + "526892 42.0 1402835246269671303 \n", + "\n", + " destination_bgrp_2020 destination_building_use \\\n", + "142645 2 (Tract 6031, San Mateo, CA) non_retail_attraction \n", + "457118 1 (Tract 3040.04, Contra Costa, CA) single_family \n", + "129084 1 (Tract 4089, Alameda, CA) retail \n", + "500586 2 (Tract 4004, Alameda, CA) retail \n", + "526892 1 (Tract 227.04, San Francisco, CA) industrial \n", + "\n", + " trip_taker_wfh destination_st_2020 destination_cty_2020 \\\n", + "142645 in_person California San Mateo \n", + "457118 in_person California Contra Costa \n", + "129084 in_person California Alameda \n", + "500586 in_person California Alameda \n", + "526892 in_person California San Francisco \n", + "\n", + " trip_taker_work_bgrp_2020 destination_trct_2020 \\\n", + "142645 2 (Tract 6001, San Mateo, CA) 6031 (San Mateo, CA) \n", + "457118 1 (Tract 227.04, San Francisco, CA) 3040.04 (Contra Costa, CA) \n", + "129084 1 (Tract 134.02, San Francisco, CA) 4089 (Alameda, CA) \n", + "500586 2 (Tract 305, San Francisco, CA) 4004 (Alameda, CA) \n", + "526892 1 (Tract 227.04, San Francisco, CA) 227.04 (San Francisco, CA) \n", + "\n", + " trip_taker_household_income origin_bgrp_2020 \\\n", + "142645 357011.0 3 (Tract 3383.02, Contra Costa, CA) \n", + "457118 113292.0 1 (Tract 227.04, San Francisco, CA) \n", + "129084 84168.0 2 (Tract 208.01, San Francisco, CA) \n", + "500586 78984.0 2 (Tract 305, San Francisco, CA) \n", + "526892 163963.0 5 (Tract 4278, Alameda, CA) \n", + "\n", + " trip_taker_commute_mode trip_taker_available_vehicles primary_mode \\\n", + "142645 private_auto three_plus private_auto \n", + "457118 private_auto one private_auto \n", + "129084 private_auto zero auto_passenger \n", + "500586 auto_passenger two auto_passenger \n", + "526892 public_transit two auto_passenger \n", + "\n", + " previous_trip_purpose trip_taker_building_type transit_submode \\\n", + "142645 shop single_family NaN \n", + "457118 work single_family NaN \n", + "129084 home multiple_units NaN \n", + "500586 work multiple_units NaN \n", + "526892 home single_family NaN \n", + "\n", + " trip_taker_work_st_2020 trip_taker_household_size origin_cty_2020 \\\n", + "142645 California 4.0 Contra Costa \n", + "457118 California 1.0 San Francisco \n", + "129084 California 2.0 San Francisco \n", + "500586 California 4.0 San Francisco \n", + "526892 California 4.0 Alameda \n", + "\n", + " destination_land_use trip_taker_industry trip_taker_tenure \\\n", + "142645 non_retail_attraction naics22 renter \n", + "457118 single_family naics62 owner \n", + "129084 retail naics62 renter \n", + "500586 retail not_working renter \n", + "526892 mixed_use naics31_33 renter \n", + "\n", + " vehicle_fuel_type trip_taker_home_trct_2020 \\\n", + "142645 other_non_bev 3553.08 (Contra Costa, CA) \n", + "457118 other_non_bev 3040.04 (Contra Costa, CA) \n", + "129084 unknown_fuel_type 208.01 (San Francisco, CA) \n", + "500586 unknown_fuel_type 604 (San Francisco, CA) \n", + "526892 unknown_fuel_type 4278 (Alameda, CA) \n", + "\n", + " trip_taker_work_trct_2020 trip_taker_education trip_start_time \\\n", + "142645 6001 (San Mateo, CA) advanced_degree 17:58:00 \n", + "457118 227.04 (San Francisco, CA) bachelors_degree 13:03:00 \n", + "129084 134.02 (San Francisco, CA) advanced_degree 17:03:00 \n", + "500586 305 (San Francisco, CA) high_school 08:27:00 \n", + "526892 227.04 (San Francisco, CA) bachelors_degree 07:42:00 \n", + "\n", + " trip_taker_individual_income trip_taker_employment_status \\\n", + "142645 136907.0 employed \n", + "457118 113292.0 employed \n", + "129084 43723.0 employed \n", + "500586 78984.0 employed \n", + "526892 163963.0 employed \n", + "\n", + " trip_purpose origin_land_use trip_taker_work_cty_2020 \\\n", + "142645 recreation retail San Mateo \n", + "457118 home education San Francisco \n", + "129084 eat multi_family San Francisco \n", + "500586 shop single_family San Francisco \n", + "526892 work single_family San Francisco \n", + "\n", + " trip_distance_miles trip_taker_school_grade_attending \\\n", + "142645 39.4 not_attending_school \n", + "457118 61.3 not_attending_school \n", + "129084 20.8 graduate \n", + "500586 15.2 not_attending_school \n", + "526892 16.5 not_attending_school \n", + "\n", + " trip_taker_home_cty_2020 trip_taker_person_id trip_end_time \n", + "142645 Contra Costa 5618592615102770741 18:48:49 \n", + "457118 Contra Costa 16118537862818643044 14:25:55 \n", + "129084 San Francisco 3167777576789264988 17:47:41 \n", + "500586 San Francisco 15001617897228539245 09:04:20 \n", + "526892 Alameda 11684344660485501674 08:16:54 " ] }, "execution_count": 10, @@ -687,6 +673,14 @@ "r_trips.sample(5)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e2199852-9b6e-46ca-86fd-abe71148d13f", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": 11, @@ -808,23 +802,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ @@ -2627,7 +2621,7 @@ }, { "cell_type": "code", - "execution_count": 124, + "execution_count": 77, "id": "6951b590-cef8-44bd-b27d-0b18893609c5", "metadata": {}, "outputs": [], @@ -2657,7 +2651,7 @@ }, { "cell_type": "code", - "execution_count": 123, + "execution_count": 80, "id": "84174911-2243-430c-ab73-1fecb2552094", "metadata": {}, "outputs": [], @@ -2675,7 +2669,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_306/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/tmp/ipykernel_327/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } @@ -2706,7 +2700,7 @@ }, { "cell_type": "code", - "execution_count": 131, + "execution_count": 84, "id": "f1267faf-e28c-4208-ae79-43b31f67f705", "metadata": {}, "outputs": [], @@ -2725,23 +2719,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ @@ -2669,7 +2683,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_327/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/tmp/ipykernel_289/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } @@ -2719,23 +2733,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ @@ -2683,7 +2663,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_289/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/tmp/ipykernel_634/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } @@ -2733,23 +2713,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trips)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"avg_trip_time\"),\n", + " color=alt.Color(\"avg_trip_time\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)\n", + " ), tooltip=trips.columns.tolist())\n", + " .properties(title = \"Average Trip Time\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "65681a29-7f1b-42ed-9e0e-371a84a29cbd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trips)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"number_trips\"),\n", + " color=alt.Color(\"number_trips\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,)\n", + " ), tooltip=trips.columns.tolist())\n", + " .properties(title=\"Number of Trips\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "0d60fe54-dc88-4570-8610-125b37b5917d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Length of Trips dataframe

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Length of Trips dataframe

\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "4f98abae-ae6b-4b4e-9427-b606a557582f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "466756" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(r_trips)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "55c6ff06-afed-45dc-b764-93188c2b9958", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Number of unique activity ids in data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Number of unique activity ids in data

\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "27c00872-5880-4464-84a5-e91423ce7895", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
number_trips
0466756
\n", + "
" + ], + "text/plain": [ + " number_trips\n", + "0 466756" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>summarize(number_trips = _.activity_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "a20cbce8-e354-4aa3-99db-666a13576b5e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Number of unique trip taker ids

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Number of unique trip taker ids

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "2def0aaf-9182-4393-8049-2dfb95749585", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
number_trips
0281798
\n", + "
" + ], + "text/plain": [ + " number_trips\n", + "0 281798" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>summarize(number_trips = _.trip_taker_person_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "47fecd22-8276-48b8-9c74-d3a94906bbae", + "metadata": {}, + "outputs": [], + "source": [ + "race_ethnicity_by_mode = r_trips>>group_by(_.primary_mode)>>count(_.trip_taker_race_ethnicity)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "4cbeb867-916b-48aa-9949-d769fcd5af5a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Trip Taker Race and Ethnicity by Mode

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Trip Taker Race and Ethnicity by Mode

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "5e895499-2142-432d-8402-c035f81326b6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(race_ethnicity_by_mode)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\"),\n", + " y=alt.Y(\"n\"),\n", + " color=alt.Color(\"trip_taker_race_ethnicity\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=race_ethnicity_by_mode[\"trip_taker_race_ethnicity\"].unique().tolist())\n", + " ),\n", + " tooltip=race_ethnicity_by_mode.columns.tolist())\n", + " \n", + " .properties(\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "da3bbe59-9b06-471f-beb1-4762b8939600", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "500ad806-51ed-47e9-88a5-fc8a41edd7aa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Transit Mode Splits

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Transit Mode Splits

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "d8cd6354-0433-4134-ad6e-9df92122cbd2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "Looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"Looking at transit mode, need to alter the transit_agency col and transit_submode to get a better count.\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "261d7f48-f7c3-4ea7-a526-6f813ca16ede", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count = (r_trips\n", + " >>filter(_.primary_mode==\"public_transit\")\n", + " >>group_by(_.primary_mode, _.transit_submode, _.transit_agency)\n", + " >>summarize(n =_.activity_id.nunique())\n", + " >>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "e4516beb-8277-4fd4-aed1-23af65fc4a28", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "727511b8-3141-40e4-b654-30aaae8200d9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Most common transit mode combinations

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Most common transit mode combinations

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "f3c31371-899f-4474-85b6-86e78e89209b", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_modes = (r_trips\n", + " >>filter(_.primary_mode ==\"public_transit\")\n", + " >>count(_.transit_submode)>>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "657ff2f3-0d0d-419d-b3d5-512212897fb1", + "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", + "
transit_submoden
2bus, bus, bus855
1bus, bus842
0bus163
8bus, light_rail, bus124
3bus, bus, bus, bus85
12light_rail, bus56
13light_rail, bus, bus24
9bus, light_rail, bus, bus18
15light_rail, light_rail, bus12
6bus, bus, subway7
\n", + "
" + ], + "text/plain": [ + " transit_submode n\n", + "2 bus, bus, bus 855\n", + "1 bus, bus 842\n", + "0 bus 163\n", + "8 bus, light_rail, bus 124\n", + "3 bus, bus, bus, bus 85\n", + "12 light_rail, bus 56\n", + "13 light_rail, bus, bus 24\n", + "9 bus, light_rail, bus, bus 18\n", + "15 light_rail, light_rail, bus 12\n", + "6 bus, bus, subway 7" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ptt_modes.head(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "80daf7a1-b947-469c-b3b0-09d0302714b7", + "metadata": {}, + "outputs": [], + "source": [ + "##### unnesting the transit submode and agencies to get counts. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "edd81120-9756-4edb-b713-1586a9fd5021", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2025391f-537e-432a-a2f4-d2d6ce57af04", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "eb27ab6b-6244-406f-b41a-55503a77521a", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['transit_submode'] = ptt_agency_count['transit_submode'].astype(str)\n", + "ptt_agency_count['transit_agency'] = ptt_agency_count['transit_agency'].astype(str)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "92ed5077-3524-4c39-8cf4-bf1b7922da2a", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['n_modes_taken'] = ptt_agency_count.transit_submode.apply(lambda x: len(x.split()))" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "c42ee93d-54ee-4fa5-97cc-447339565d4a", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count>>arrange(-_.n_modes_taken)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d93bd0e-f30d-4a53-9077-25818eef0cf7", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "cb12d509-d786-458c-894a-193c80666bb6", + "metadata": {}, + "outputs": [], + "source": [ + "## This line of code gets all agencies listed, even if agency is named twice. \n", + "## Need code that counts the unique agencies\n", + "#ptt_agency_count['agency_count'] = ptt_agency_count.transit_agency.apply(lambda x: len(x.split(\", \")))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "2fb65c2c-5a23-4082-8e4e-f1d4ab231f0a", + "metadata": {}, + "outputs": [], + "source": [ + "ptt_agency_count['agency_count'] = [len(set(x.split(\", \"))) for x in\n", + " ptt_agency_count['transit_agency'].str.lower()]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "589d2a23-b528-4de9-b6a0-a10f88a6da5c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "505f47b1-229a-4cd1-90b8-b83b4ccdd6c6", + "metadata": {}, + "outputs": [], + "source": [ + "modes_count = ptt_agency_count>>group_by(_.n_modes_taken)>>summarize(n_trips = _.n.sum())" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "97746912-39f0-4c85-80d3-a00ed47922a8", + "metadata": {}, + "outputs": [], + "source": [ + "# modes_count" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "5353a2e4-762d-4a27-8f32-267c2c55bb90", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart((modes_count))\n", + " .mark_bar(size=60)\n", + " .encode(\n", + " x=alt.X(\"n_modes_taken\", title =\"Number of Modes Taken per Trip\"),\n", + " y=alt.Y(\"n_trips\", title = \"Number of Trips\"),\n", + " color=alt.Color(\"n_trips\", title = \"Number of Trips\",\n", + " scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)),\n", + " tooltip=modes_count.columns.tolist())\n", + " \n", + " .properties(title = \"How Many Modes are Taken Per Trip\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "fb8565b9-989a-459a-bede-433de30252e7", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count>>group_by(_.agency_count)>>count(_.n_modes_taken)>>arrange(-_.n)\n", + "agency_mode_trips = ptt_agency_count>>group_by(_.agency_count, _.n_modes_taken)>>summarize(ntrips=_.n.sum())>>arrange(-_.ntrips)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "b03dbe0a-a759-4fa9-849b-b31b318f86cd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart((agency_mode_trips))\n", + " .mark_circle(size=100)\n", + " .encode(\n", + " x=alt.X(\"agency_count\", title =\"Number of Agencies\"),\n", + " y=alt.Y(\"n_modes_taken\", title = \"Number of Modes Taken\"),\n", + " color=alt.Color(\"ntrips\", title = \"Number of Trips\",\n", + " scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS)),\n", + " tooltip=agency_mode_trips.columns.tolist())\n", + " \n", + " .properties(title = \"How Many Modes are Taken Per Trip\",\n", + " width=800,\n", + " height=300)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "91273d26-1fd1-42a1-b829-a77398c606fc", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "6bd200d7-c0b9-4649-adf1-e025d216328b", + "metadata": {}, + "outputs": [], + "source": [ + "##### Getting columns for each agency and counts " + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "e8f5f457-ce9f-4bfb-99f6-82e6eb7d11f0", + "metadata": { + "scrolled": true, + "tags": [] + }, + "outputs": [], + "source": [ + "# ptt_agency_count['transit_agency'].unique().tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "4b48b976-e4c7-4b8f-81d0-f3a54ed33a5e", + "metadata": {}, + "outputs": [], + "source": [ + "## Get just one columns\n", + "column = ptt_agency_count[[\"transit_agency\"]]\n", + "#remove single-dimensional entries from the shape of an array\n", + "col_text = column.squeeze()\n", + "# get list of words\n", + "text_list = col_text.tolist()\n", + "# #join list of words \n", + "text_list = ', '.join(text_list).title()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7dc09e0d-9001-42fa-babc-fb08a590c947", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "f430e943-c918-4449-8e62-e0d33ba82aff", + "metadata": {}, + "outputs": [], + "source": [ + "text_list = text_list.replace(\", \", \"', '\")" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "740afd55-23fe-403a-bfe5-037aa6802c0c", + "metadata": {}, + "outputs": [], + "source": [ + "text_list = \"['\" + text_list + \"']\"" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "09ee5ac0-1bf2-40d4-8d29-7397d9b84d9e", + "metadata": { + "scrolled": true, + "tags": [] + }, + "outputs": [], + "source": [ + "# text_list" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "3c399936-bc62-491c-b71d-89a861e02fc7", + "metadata": {}, + "outputs": [], + "source": [ + "import ast\n" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "5ae1e7f0-9e1c-4795-a3cc-d16f98e039d2", + "metadata": {}, + "outputs": [], + "source": [ + "agency_list = ast.literal_eval(text_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "cc080910-1ad8-4303-a825-eb4370f78f5c", + "metadata": {}, + "outputs": [], + "source": [ + "agency_list = set(agency_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "416d16f0-3128-4857-9136-69f0403ce5cc", + "metadata": {}, + "outputs": [], + "source": [ + "# len(agency_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "f303acae-da1b-44a5-98b2-2f8f5b98f56a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Agencies Identified in Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "{'Amtrak',\n", + " 'Avta',\n", + " 'Beach Cities Transit-City Of Redondo Beach',\n", + " 'Big Blue Bus',\n", + " 'Culver Citybus',\n", + " 'Foothill Transit',\n", + " 'Gtrans',\n", + " 'La Go Bus',\n", + " 'Ladot126',\n", + " 'Ladotdt',\n", + " 'Ladotmvn',\n", + " 'Ladotmvs',\n", + " 'Long Beach Transit',\n", + " 'Metro - Los Angeles',\n", + " 'Metrolink Trains',\n", + " 'Santa Clarita Transit'}" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "display(HTML(\"

Agencies Identified in Trips Data

\")) \n", + "\n", + "(agency_list)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8b121b63-083b-4898-9eb1-cb919698d9ca", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d737409e-38b2-4aa9-8cac-4ad3b8e22294", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6d5ebb21-1aaf-4743-aa0a-feb58ed44da2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "b4548765-653e-4d07-88e6-6cc7c2d40f7b", + "metadata": {}, + "outputs": [], + "source": [ + "#### using this stackoverflow code to count the instances of the transit agencies in the data" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "bd1a6f28-2b26-4919-87c7-b55027aea1b9", + "metadata": {}, + "outputs": [], + "source": [ + "## https://stackoverflow.com/questions/46250505/count-the-number-of-times-multiple-substrings-appear-in-dataframe-column" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "id": "9a738907-d239-4067-b813-bc603a3c85de", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count['transit_agency'] = ptt_agency_count['transit_agency'].str.strip('()').str.split(',')" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "8d5f235d-30c4-4455-b9c8-283007badeeb", + "metadata": {}, + "outputs": [], + "source": [ + "# ptt_agency_count.join(ptt_agency_count['transit_agency'].str.join('|').str.get_dummies())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "34eada82-1f1c-4411-8dd4-3bb71b0ddb16", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "71af6e25-52b0-45e9-ba2b-a00a670e3010", + "metadata": {}, + "outputs": [], + "source": [ + "### making a copy of the ptt_agency_count\n", + "df = ptt_agency_count.copy()" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "77c19b04-a01a-4631-9db4-a30b54fdff36", + "metadata": {}, + "outputs": [], + "source": [ + "# df['transit_agency'] = df['transit_agency'].astype(str)" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "id": "1ed407a8-9c32-41ba-8ad8-15e422d14c0a", + "metadata": {}, + "outputs": [], + "source": [ + "# df2 = df['transit_agency'].str.get_dummies(sep=', ')" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "id": "0ffb0504-e0d1-4b41-856b-d686b2408857", + "metadata": {}, + "outputs": [], + "source": [ + "# df2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5bdc0792-219c-4877-880c-cd7d84db2303", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2de92f7b-2e28-4388-880f-9e34b8b603ea", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "89479d3a-eeb5-491a-a064-49a77194109e", + "metadata": {}, + "source": [ + "##### Trying ChatGPT approach" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "id": "bd6f46a5-404f-41eb-9fd8-4600451e6d20", + "metadata": {}, + "outputs": [], + "source": [ + "agency_indv_count = (r_trips>>filter(_.primary_mode==\"public_transit\")>>select(_.transit_agency))\n", + "agency_indv_count['transit_agency'] = agency_indv_count['transit_agency'].astype(str)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "id": "6c664504-dad9-47f8-929a-dbb8810af191", + "metadata": {}, + "outputs": [], + "source": [ + "# transit_agencies = set()\n", + "# for agencies in df['transit_agency'].str.split(', '):\n", + "# transit_agencies.update(agencies)" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "f577e93c-5cf9-4a2b-95b7-a6cd8577c4d8", + "metadata": {}, + "outputs": [], + "source": [ + "# unique_agencies = []" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "daa329d5-ab43-4d91-9f24-529cc929118c", + "metadata": {}, + "outputs": [], + "source": [ + "# for agency in transit_agencies:\n", + "# df[agency] = df['transit_agency'].str.count(agency)\n", + "# unique_agencies.append(agency)" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "id": "bb062bcd-4322-4970-9115-7ea91ba7041c", + "metadata": {}, + "outputs": [], + "source": [ + "# ### adding column for unique agencies list\n", + "# def get_unique_agencies(agency_list):\n", + "# unique_agencies = set()\n", + "# for agencies in agency_list:\n", + "# unique_agencies.update(agencies.split(', '))\n", + "# return ', '.join(sorted(list(unique_agencies)))\n", + "\n", + "# # Applying the function to each row of the dataframe to get unique agencies\n", + "# df['unique_agencies'] = df['transit_agency'].str.split(', ').apply(lambda x: get_unique_agencies(x))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6a011752-5211-40b4-a108-a8036fdbacce", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "045be8fb-d8fd-4019-8282-df53602b122b", + "metadata": {}, + "outputs": [], + "source": [ + "def get_dummies_by_agency(df, col):\n", + " transit_agencies = set()\n", + " for agencies in df[col].str.split(', '):\n", + " transit_agencies.update(agencies)\n", + " unique_agencies = []\n", + " \n", + " for agency in transit_agencies:\n", + " df[agency] = df[col].str.count(agency)\n", + " unique_agencies.append(agency)\n", + "\n", + " ### adding column for unique agencies list\n", + " def get_unique_agencies(agency_list):\n", + " unique_agencies = set()\n", + " for agencies in agency_list:\n", + " unique_agencies.update(agencies.split(', '))\n", + " return ', '.join(sorted(list(unique_agencies)))\n", + "\n", + " # Applying the function to each row of the dataframe to get unique agencies\n", + " df['unique_agencies'] = df[col].str.split(', ').apply(lambda x: get_unique_agencies(x))\n", + " \n", + " return df" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "efc4eb07-c0f9-4bc2-87bb-cac95f606657", + "metadata": {}, + "outputs": [], + "source": [ + "df = get_dummies_by_agency(df, \"transit_agency\")" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "id": "cefbf215-185b-423d-b154-731fb0fa6a39", + "metadata": {}, + "outputs": [], + "source": [ + "agency_indv_count = get_dummies_by_agency(agency_indv_count, \"transit_agency\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cbc9e090-d0d0-4632-9de7-4f225c61b6a4", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "941dbff8-a45b-404c-826b-0f696f91c5a0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 67, + "id": "97bc34c4-636f-46ca-a257-95e4af242584", + "metadata": {}, + "outputs": [], + "source": [ + "##### Identifying trips with one agency" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "46856b31-47ac-408c-903e-19d8b04283f7", + "metadata": {}, + "outputs": [], + "source": [ + "cols_to_keep = [\"transit_submode\",\"unique_agencies\", \"n\",\"n_modes_taken\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "id": "2603e7e0-389a-49fb-93e9-5dc1d52c6012", + "metadata": {}, + "outputs": [], + "source": [ + "# chart = (alt.Chart(df)\n", + "# .mark_circle(size=100)\n", + "# .encode(\n", + "# x=alt.X(\"n_modes_taken\", title=\"Number of Modes taken\"),\n", + "# y=alt.Y(\"n\", title=\"Number of Trips\"),\n", + "# color = alt.Color(\"agency_count\", title=\"Number of Unique Agencies\",\n", + "# scale=alt.Scale(\n", + "# range=cp.CALITP_DIVERGING_COLORS,\n", + "# domain=df[\"agency_count\"].unique().tolist())\n", + "# ),\n", + "# tooltip=cols_to_keep)\n", + "# .properties(title = (\"Transit Trips Agency Breakdown\"), width=500,\n", + "# height=300)\n", + "# )\n", + "# chart " + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "id": "149ed63c-436c-45fe-a526-5b1bf9f3d6fb", + "metadata": {}, + "outputs": [], + "source": [ + "# (df>>filter(_.agency_count==1)>>arrange(-_.n))" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "7228c540-3033-4023-8145-91f8aee23eeb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (alt.Chart((df>>filter(_.agency_count==1)))\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"unique_agencies\", title=\"Agency\"),\n", + " y=alt.Y(\"n\", title=\"Number of Modes taken\"),\n", + " color = alt.Color(\"n_modes_taken\", title=\"Number of Trips\",\n", + " scale=alt.Scale(\n", + " range=cp.CALITP_SEQUENTIAL_COLORS,)),\n", + " tooltip=cols_to_keep)\n", + " .properties(title = (\"Transit Trips With Only One Agency\"), width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Most Common Agency Combination

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "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", + "
transit_agency
15Metro - Los Angeles, Metro - Los Angeles
57Metro - Los Angeles, Metro - Los Angeles, Metro - Los Angeles
27Big Blue Bus, Metro - Los Angeles, Metro - Los Angeles
5Big Blue Bus, Metro - Los Angeles
1Metro - Los Angeles
\n", + "
" + ], + "text/plain": [ + " transit_agency\n", + "15 Metro - Los Angeles, Metro - Los Angeles\n", + "57 Metro - Los Angeles, Metro - Los Angeles, Metro - Los Angeles\n", + "27 Big Blue Bus, Metro - Los Angeles, Metro - Los Angeles\n", + "5 Big Blue Bus, Metro - Los Angeles\n", + "1 Metro - Los Angeles" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "display(HTML(\"

Most Common Agency Combination

\")) \n", + "\n", + "(df>>arrange(-_.n)>>select(_.transit_agency)).head(5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "786394ef-be26-4e0d-94e7-35386d6d67c0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd43ab95-0391-407b-b6b0-185034ba9528", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 102, + "id": "8af03d60-4537-44d3-b82f-d857625e47c3", + "metadata": {}, + "outputs": [], + "source": [ + "columns_to_keep = [\"AVTA\",\n", + " \"Beach Cities Transit-City of Redondo Beach\",\n", + " \"LADOT126\",\n", + " \"Metro - Los Angeles\",\n", + " \"LA Go Bus\",\n", + " \"LADOTDT\",\n", + " \"Amtrak\",\n", + " \"Big Blue Bus\",\n", + " \"GTrans\",\n", + " \"LADOTMVN\",\n", + " \"Long Beach Transit\",\n", + " \"Santa Clarita Transit\",\n", + " \"Foothill Transit\",\n", + " \"Culver CityBus\",\n", + " \"Metrolink Trains\",\n", + " \"LADOTMVS\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "id": "6951b590-cef8-44bd-b27d-0b18893609c5", + "metadata": {}, + "outputs": [], + "source": [ + "# agency_indv_count.sample()" + ] + }, + { + "cell_type": "code", + "execution_count": 104, + "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = agency_indv_count.loc[:, columns_to_keep]" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "id": "814dde3a-d303-4044-9df1-464e408bf460", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "id": "84174911-2243-430c-ab73-1fecb2552094", + "metadata": {}, + "outputs": [], + "source": [ + "# df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 107, + "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_798/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" + ] + } + ], + "source": [ + "df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", + "metadata": {}, + "outputs": [], + "source": [ + "df_agencies = df_agencies>>select(_.agency, _.n_trips)" + ] + }, + { + "cell_type": "code", + "execution_count": 109, + "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", + "metadata": {}, + "outputs": [], + "source": [ + "tooltip_cols = [\"agency\", \"n_trips\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 110, + "id": "f1267faf-e28c-4208-ae79-43b31f67f705", + "metadata": {}, + "outputs": [], + "source": [ + "# df_agencies" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 113, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (alt.Chart(df_agencies)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"agency\", title = \"Agency Name\"),\n", + " y=alt.Y(\"n_trips\", title= \"Number of boardings reported for trips (One person taking two LA Metro trips will count as 2)\"),\n", + " color=alt.Color(\"n_trips\", scale=alt.Scale(range = cp.CALITP_SEQUENTIAL_COLORS)),\n", + " tooltip = tooltip_cols)\n", + " .properties(title = \"Number of Times an Agency was used for Trip Taking\",\n", + " width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a59f170f-b2e0-41b3-ae7a-1ae4eca12596", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Trips by Resident Type

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Trips by Resident Type

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5163926e-82bd-4c25-9486-45229d09a0d1", + "metadata": {}, + "outputs": [], + "source": [ + "trip_by_res_type = (r_trips\n", + " >>group_by(_.primary_mode,_.trip_taker_resident_type)\n", + " >>summarize(number_trips = _.activity_id.nunique())\n", + " >>arrange(_.primary_mode))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", + "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", + "
primary_modetrip_taker_resident_typenumber_trips
0auto_passengercore116685
1auto_passengerdonut2
2auto_passengervisitor28818
3commercialNaN10154
4on_demand_autocore3191
5on_demand_autovisitor595
6private_autocore294704
7private_autodonut1
8private_autovisitor10394
9private_autoNaN1
10public_transitcore2155
11public_transitvisitor56
\n", + "
" + ], + "text/plain": [ + " primary_mode trip_taker_resident_type number_trips\n", + "0 auto_passenger core 116685\n", + "1 auto_passenger donut 2\n", + "2 auto_passenger visitor 28818\n", + "3 commercial NaN 10154\n", + "4 on_demand_auto core 3191\n", + "5 on_demand_auto visitor 595\n", + "6 private_auto core 294704\n", + "7 private_auto donut 1\n", + "8 private_auto visitor 10394\n", + "9 private_auto NaN 1\n", + "10 public_transit core 2155\n", + "11 public_transit visitor 56" + ] + }, + "execution_count": 94, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trip_by_res_type" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "90c5d683-91c5-4663-accd-4e45027a3e49", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chart = (\n", + " alt.Chart(trip_by_res_type)\n", + " .mark_bar()\n", + " .encode(\n", + " x=alt.X(\"primary_mode\", title = \"Mode\"),\n", + " y=alt.Y(\"number_trips\", title = \"Number of Trips\"),\n", + " color=alt.Color(\"trip_taker_resident_type\", scale=alt.Scale(range = cp.CALITP_DIVERGING_COLORS,\n", + " domain=trip_by_res_type[\"trip_taker_resident_type\"].unique().tolist())\n", + " ),\n", + " tooltip=trip_by_res_type.columns.tolist())\n", + " .properties(title = \"Trips by Resident Type\",\n", + " width=800,\n", + " height=500)\n", + " )\n", + "chart " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f7b51fbb-8b87-4863-bcd9-50ed5047d7d6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "878c5c8e-18c3-456a-b641-67ad010f5101", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Unique Household Ids

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Unique Household Ids

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2a31bf27-ccc4-4ce3-8b6a-31dbd14caaf2", + "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", + "
trip_taker_household_idn
16079033634
267303NaN16384
79436914681705355861243316
23626270997282611727185215
30303348816763554965846314
.........
26729699991308544966717651
2672999999309614445944191
26730099995343586234221581
26730199998863480992582371
26730299999027557241477141
\n", + "

267304 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " trip_taker_household_id n\n", + "160790 33634\n", + "267303 NaN 16384\n", + "79436 9146817053558612433 16\n", + "23626 2709972826117271852 15\n", + "30303 3488167635549658463 14\n", + "... ... ...\n", + "267296 9999130854496671765 1\n", + "267299 999930961444594419 1\n", + "267300 9999534358623422158 1\n", + "267301 9999886348099258237 1\n", + "267302 9999902755724147714 1\n", + "\n", + "[267304 rows x 2 columns]" + ] + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>count(_.trip_taker_household_id)>>arrange(-_.n)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eb9780a3-b996-45af-9cc3-b41629ec0e55", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Checking one household id

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Checking one household id

\")) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "id": "6fc3be54-b8dc-4cf8-893e-565ffa02934d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "16\n" + ] + }, + { + "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", + "
activity_idorigin_bgrp_2020origin_trct_2020origin_cty_2020origin_st_2020destination_bgrp_2020destination_trct_2020destination_cty_2020destination_st_2020primary_modetrip_purposeprevious_trip_purposetrip_start_timetrip_end_timetrip_duration_minutestrip_distance_milesvehicle_typevehicle_fuel_typetransit_submodetransit_agencytransit_routeorigin_land_useorigin_building_usedestination_land_usedestination_building_usetrip_taker_person_idtrip_taker_household_idtrip_taker_agetrip_taker_sextrip_taker_race_ethnicitytrip_taker_employment_statustrip_taker_wfhtrip_taker_individual_incometrip_taker_commute_modetrip_taker_household_sizetrip_taker_household_incometrip_taker_available_vehiclestrip_taker_resident_typetrip_taker_industrytrip_taker_building_typetrip_taker_school_grade_attendingtrip_taker_educationtrip_taker_tenuretrip_taker_languagetrip_taker_home_bgrp_2020trip_taker_home_trct_2020trip_taker_home_cty_2020trip_taker_home_st_2020trip_taker_work_bgrp_2020trip_taker_work_trct_2020trip_taker_work_cty_2020trip_taker_work_st_2020
29541374136979447952206132 (Tract 1349.05, Los Angeles, CA)1349.05 (Los Angeles, CA)Los Angeles County, CACalifornia1 (Tract 2623.01, Los Angeles, CA)2623.01 (Los Angeles, CA)Los Angeles County, CACaliforniaprivate_autohomeschool11:55:0012:41:214612.7unknown_vehicle_typeother_non_bevNaNNaNNaNeducationeducationsingle_familysingle_family4508016952300979367914681705355861243325.0femaleasian_not_hispanic_or_latinoemployedemployed_not_working79807.0private_auto11.0318660.0three_pluscorenaics62single_familynot_attending_schoolbachelors_degreeownerasian_pacific1 (Tract 2623.01, Los Angeles, CA)2623.01 (Los Angeles, CA)Los Angeles County, CACalifornia1 (Tract 759.01, Orange, CA)759.01 (Orange, CA)Orange County, CACalifornia
\n", + "
" + ], + "text/plain": [ + " activity_id origin_bgrp_2020 \\\n", + "295413 7413697944795220613 2 (Tract 1349.05, Los Angeles, CA) \n", + "\n", + " origin_trct_2020 origin_cty_2020 origin_st_2020 \\\n", + "295413 1349.05 (Los Angeles, CA) Los Angeles County, CA California \n", + "\n", + " destination_bgrp_2020 destination_trct_2020 \\\n", + "295413 1 (Tract 2623.01, Los Angeles, CA) 2623.01 (Los Angeles, CA) \n", + "\n", + " destination_cty_2020 destination_st_2020 primary_mode trip_purpose \\\n", + "295413 Los Angeles County, CA California private_auto home \n", + "\n", + " previous_trip_purpose trip_start_time trip_end_time \\\n", + "295413 school 11:55:00 12:41:21 \n", + "\n", + " trip_duration_minutes trip_distance_miles vehicle_type \\\n", + "295413 46 12.7 unknown_vehicle_type \n", + "\n", + " vehicle_fuel_type transit_submode transit_agency transit_route \\\n", + "295413 other_non_bev NaN NaN NaN \n", + "\n", + " origin_land_use origin_building_use destination_land_use \\\n", + "295413 education education single_family \n", + "\n", + " destination_building_use trip_taker_person_id trip_taker_household_id \\\n", + "295413 single_family 4508016952300979367 9146817053558612433 \n", + "\n", + " trip_taker_age trip_taker_sex trip_taker_race_ethnicity \\\n", + "295413 25.0 female asian_not_hispanic_or_latino \n", + "\n", + " trip_taker_employment_status trip_taker_wfh \\\n", + "295413 employed employed_not_working \n", + "\n", + " trip_taker_individual_income trip_taker_commute_mode \\\n", + "295413 79807.0 private_auto \n", + "\n", + " trip_taker_household_size trip_taker_household_income \\\n", + "295413 11.0 318660.0 \n", + "\n", + " trip_taker_available_vehicles trip_taker_resident_type \\\n", + "295413 three_plus core \n", + "\n", + " trip_taker_industry trip_taker_building_type \\\n", + "295413 naics62 single_family \n", + "\n", + " trip_taker_school_grade_attending trip_taker_education \\\n", + "295413 not_attending_school bachelors_degree \n", + "\n", + " trip_taker_tenure trip_taker_language \\\n", + "295413 owner asian_pacific \n", + "\n", + " trip_taker_home_bgrp_2020 trip_taker_home_trct_2020 \\\n", + "295413 1 (Tract 2623.01, Los Angeles, CA) 2623.01 (Los Angeles, CA) \n", + "\n", + " trip_taker_home_cty_2020 trip_taker_home_st_2020 \\\n", + "295413 Los Angeles County, CA California \n", + "\n", + " trip_taker_work_bgrp_2020 trip_taker_work_trct_2020 \\\n", + "295413 1 (Tract 759.01, Orange, CA) 759.01 (Orange, CA) \n", + "\n", + " trip_taker_work_cty_2020 trip_taker_work_st_2020 \n", + "295413 Orange County, CA California " + ] + }, + "execution_count": 116, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "print(len(r_trips>>filter(_.trip_taker_household_id == 9146817053558612433)))\n", + "(r_trips>>filter(_.trip_taker_household_id == 9146817053558612433)).sample()" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "id": "4eccfdf8-429e-43df-899e-f7d77e051831", + "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", + "
trip_taker_person_idtrip_taker_agetrip_taker_sextrip_taker_household_sizen
0450801695230097936725.0female11.05
1473639835695628221238.0female11.02
2842348430858681588432.0female11.02
31239501264766598930521.0female11.01
41467359267154790875118.0female11.04
51654563495774756539849.0female11.01
61668411545259606681653.0male11.01
\n", + "
" + ], + "text/plain": [ + " trip_taker_person_id trip_taker_age trip_taker_sex \\\n", + "0 4508016952300979367 25.0 female \n", + "1 4736398356956282212 38.0 female \n", + "2 8423484308586815884 32.0 female \n", + "3 12395012647665989305 21.0 female \n", + "4 14673592671547908751 18.0 female \n", + "5 16545634957747565398 49.0 female \n", + "6 16684115452596066816 53.0 male \n", + "\n", + " trip_taker_household_size n \n", + "0 11.0 5 \n", + "1 11.0 2 \n", + "2 11.0 2 \n", + "3 11.0 1 \n", + "4 11.0 4 \n", + "5 11.0 1 \n", + "6 11.0 1 " + ] + }, + "execution_count": 117, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## checking one household id\n", + "r_trips>>filter(_.trip_taker_household_id == 9146817053558612433)>>count(_.trip_taker_person_id, _.trip_taker_age,\n", + " _.trip_taker_sex, _.trip_taker_household_size)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c929c77d-0173-4a7d-be49-762349daf5cb", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ab226b47-4366-4fb9-aaae-e0aca760f9b3", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 118, + "id": "1483249f-602c-4805-bcc4-d55e018022ad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

Number of Travelers by Resident Type: Replica Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display(HTML(\"

Number of Travelers by Resident Type: Replica Trips Data

\")) " + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "id": "5c1894f0-bd42-4014-89d4-6e8d43809319", + "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", + "
trip_taker_resident_type_unique_ids
0core246597
1donut2
2visitor35198
3NaN1
\n", + "
" + ], + "text/plain": [ + " trip_taker_resident_type _unique_ids\n", + "0 core 246597\n", + "1 donut 2\n", + "2 visitor 35198\n", + "3 NaN 1" + ] + }, + "execution_count": 119, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r_trips>>group_by(_.trip_taker_resident_type)>>summarize(_unique_ids = _.trip_taker_person_id.nunique())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b0891b62-c968-4ea0-bd9b-753d299a5054", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 120, + "id": "2e4bd058-9c4d-4989-a5fc-db6cf6130bf2", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/html": [ + "

Traveler Demographics: Replica Trips Data

" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "Fitered for Core Residents" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "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", + "
primary_modetrip_taker_sexn_pplavg_h_incomeavg_p_incomeavg_age
0auto_passengerfemale44266162899.90238657807.90703543.646941
1auto_passengermale43836173439.45809687237.70432742.863541
2commercialNaN1NaNNaNNaN
3on_demand_autofemale1560181325.51590858599.18590146.576419
4on_demand_automale1532181278.14294792035.74370343.226700
5private_autofemale90634167383.18935162989.92362143.786498
6private_automale99967174477.15784594470.93201343.811427
7private_autoNaN1NaNNaNNaN
8public_transitfemale92781553.44691139058.57239442.898649
9public_transitmale97997733.90616644295.89633639.824844
\n", + "
" + ], + "text/plain": [ + " primary_mode trip_taker_sex n_ppl avg_h_income avg_p_income \\\n", + "0 auto_passenger female 44266 162899.902386 57807.907035 \n", + "1 auto_passenger male 43836 173439.458096 87237.704327 \n", + "2 commercial NaN 1 NaN NaN \n", + "3 on_demand_auto female 1560 181325.515908 58599.185901 \n", + "4 on_demand_auto male 1532 181278.142947 92035.743703 \n", + "5 private_auto female 90634 167383.189351 62989.923621 \n", + "6 private_auto male 99967 174477.157845 94470.932013 \n", + "7 private_auto NaN 1 NaN NaN \n", + "8 public_transit female 927 81553.446911 39058.572394 \n", + "9 public_transit male 979 97733.906166 44295.896336 \n", + "\n", + " avg_age \n", + "0 43.646941 \n", + "1 42.863541 \n", + "2 NaN \n", + "3 46.576419 \n", + "4 43.226700 \n", + "5 43.786498 \n", + "6 43.811427 \n", + "7 NaN \n", + "8 42.898649 \n", + "9 39.824844 " + ] + }, + "execution_count": 120, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "display(HTML(\"

Traveler Demographics: Replica Trips Data

\")) \n", + "display(HTML(\"Fitered for Core Residents\")) \n", + "(r_trips\n", + " >>filter(_.trip_taker_home_bgrp_2020!=\"Visitor (no home location)\")\n", + " >>group_by(_.primary_mode, _.trip_taker_sex)\n", + " >>summarize(\n", + " n_ppl = _.trip_taker_person_id.nunique(),\n", + " avg_h_income = _.trip_taker_household_income.mean(),\n", + " avg_p_income = _.trip_taker_individual_income.mean(),\n", + " avg_age = _.trip_taker_age.mean())\n", + ")\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1dba8b5-7356-441f-8e6c-0f98e0f80c4c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "aa84cc8c-8b17-41b6-abdf-c8397ef1e706", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "101bbd51-38b9-4791-8119-f0dc3002b6a6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bbc819b1-0dfc-46be-90bd-b136263dc22c", + "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" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c3c2fb8ddab03040e0c7b3b23acf8b2eb6a8b8f6 Mon Sep 17 00:00:00 2001 From: natam1 Date: Thu, 30 May 2024 22:02:52 +0000 Subject: [PATCH 14/16] move funct over to utils --- sb125_analyses/corridor_study/_utils.py | 78 + .../data_downloads_skirball.ipynb | 2203 +++++++++++------ 2 files changed, 1463 insertions(+), 818 deletions(-) diff --git a/sb125_analyses/corridor_study/_utils.py b/sb125_analyses/corridor_study/_utils.py index 4bc61bb7a..5d84d4ba4 100644 --- a/sb125_analyses/corridor_study/_utils.py +++ b/sb125_analyses/corridor_study/_utils.py @@ -1,5 +1,10 @@ +""" +Replica and Streetlight Analysis Utils +""" + import pandas as pd from siuba import * +import ast from calitp_data_analysis.sql import to_snakecase @@ -7,3 +12,76 @@ from calitp_data_analysis import calitp_color_palette as cp +""" +Replica Analysis Utils +""" +##function that returns Replica transit data into df we can analyze easier +def get_tranist_agency_counts(df, primary_mode_col, transit_mode_col, transit_agency_col, activity_id_col): + ## return a df with the agency counts + agencies = (df + >>filter(_[primary_mode_col] =="public_transit") + >>group_by(_[primary_mode_col], _[transit_mode_col], _[transit_agency_col]) + >>summarize(n =_[activity_id_col].nunique()) + >>arrange(-_.n)) + + agencies[transit_mode_col] = agencies[transit_mode_col].astype(str) + agencies[transit_agency_col] = agencies[transit_agency_col].astype(str) + + agencies['agency_count'] = [len(set(x.split(", "))) for x in + agencies[transit_agency_col].str.lower()] + agencies['n_modes_taken'] = agencies[transit_mode_col].apply(lambda x: len(x.split())) + + ## return a df with the mode counts + modes = (df + >>filter(_[primary_mode_col] =="public_transit") + >>count(_[transit_mode_col])>>arrange(-_.n)) + modes['n_modes_taken'] = modes[transit_mode_col].apply(lambda x: len(x.split())) + + return agencies, modes + +def get_list_of_agencies(df, transit_agency_col): + + ## Get just one columns + column = df[[transit_agency_col]] + #remove single-dimensional entries from the shape of an array + col_text = column.squeeze() + # get list of words + text_list = col_text.tolist() + # #join list of words + text_list = ', '.join(text_list).title() + + text_list = text_list.replace(", ", "', '") + text_list = "['" + text_list + "']" + + agency_list = ast.literal_eval(text_list) + agency_list = set(agency_list) + + return agency_list + +def get_dummies_by_agency(df, col): + transit_agencies = set() + for agencies in df[col].str.split(', '): + transit_agencies.update(agencies) + unique_agencies = [] + + for agency in transit_agencies: + df[agency] = df[col].str.count(agency) + unique_agencies.append(agency) + + ### adding column for unique agencies list + def get_unique_agencies(agency_list): + unique_agencies = set() + for agencies in agency_list: + unique_agencies.update(agencies.split(', ')) + return ', '.join(sorted(list(unique_agencies))) + + # Applying the function to each row of the dataframe to get unique agencies + df['unique_agencies'] = df[col].str.split(', ').apply(lambda x: get_unique_agencies(x)) + + return df + +""" +Streetlight Analysis Utils +""" + + diff --git a/sb125_analyses/corridor_study/data_downloads_skirball.ipynb b/sb125_analyses/corridor_study/data_downloads_skirball.ipynb index e8c52db81..91b7ce9b1 100644 --- a/sb125_analyses/corridor_study/data_downloads_skirball.ipynb +++ b/sb125_analyses/corridor_study/data_downloads_skirball.ipynb @@ -19,7 +19,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_798/4150955979.py:10: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n", + "/tmp/ipykernel_515/2202862553.py:12: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n", " from IPython.core.display import display\n" ] } @@ -27,6 +27,8 @@ "source": [ "import pandas as pd\n", "from siuba import *\n", + "import ast\n", + "\n", "\n", "from calitp_data_analysis.sql import to_snakecase\n", "\n", @@ -42,6 +44,16 @@ { "cell_type": "code", "execution_count": 2, + "id": "c0ea35c1-246d-4356-ad1c-83fe9cc437ff", + "metadata": {}, + "outputs": [], + "source": [ + "import _utils" + ] + }, + { + "cell_type": "code", + "execution_count": 3, "id": "651aae92-5188-4676-8e5f-3c040f77077c", "metadata": {}, "outputs": [], @@ -52,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "af402da0-0b03-4c71-a1af-19f97f67cef1", "metadata": {}, "outputs": [], @@ -70,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "0e5c1b44-c981-4a9a-b6ea-e1cb2a7a279e", "metadata": {}, "outputs": [], @@ -88,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "id": "cb3dea26-4e6d-4dc7-acc8-27b899a0a537", "metadata": {}, "outputs": [ @@ -96,7 +108,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_798/2643890524.py:1: DtypeWarning: Columns (18,19,20,25,26,28,29,30,31,33,36,38,39,40,41,42,43) have mixed types. Specify dtype option on import or set low_memory=False.\n", + "/tmp/ipykernel_515/2643890524.py:1: DtypeWarning: Columns (18,19,20,25,26,28,29,30,31,33,36,38,39,40,41,42,43) have mixed types. Specify dtype option on import or set low_memory=False.\n", " r_trips = to_snakecase(pd.read_csv(f\"{GCS_PATH}{replica_trips}\"))\n" ] } @@ -107,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "ca697494-b872-4de8-afd9-c538a455364c", "metadata": {}, "outputs": [ @@ -130,7 +142,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "id": "4713b1a5-ccac-4e1b-8552-850285cad53e", "metadata": {}, "outputs": [ @@ -211,78 +223,78 @@ " \n", " \n", " \n", - " 177890\n", - " 15350592806243147042\n", - " 1 (Tract 438.21, Riverside, CA)\n", - " 438.21 (Riverside, CA)\n", - " Riverside County, CA\n", + " 423350\n", + " 5926084662673022461\n", + " 1 (Tract 2643.05, Los Angeles, CA)\n", + " 2643.05 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", " California\n", - " 1 (Tract 1318.01, Los Angeles, CA)\n", - " 1318.01 (Los Angeles, CA)\n", + " 3 (Tract 9105.01, Los Angeles, CA)\n", + " 9105.01 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", " private_auto\n", " work\n", " home\n", - " 16:50:00\n", - " 19:36:15\n", - " 166\n", - " 108.7\n", + " 14:57:00\n", + " 16:25:56\n", + " 88\n", + " 57.2\n", " unknown_vehicle_type\n", " other_non_bev\n", " NaN\n", " NaN\n", " NaN\n", - " single_family\n", - " single_family\n", " mixed_use\n", - " office\n", - " 13837498645562403926\n", - " 8821470648757336257\n", - " 30.0\n", - " female\n", - " aian_not_hispanic_or_latino\n", + " multi_family\n", + " civic_institutional\n", + " civic_institutional\n", + " 9280162199592818201\n", + " 3819422246701548245\n", + " 59.0\n", + " male\n", + " white_not_hispanic_or_latino\n", " employed\n", " in_person\n", - " 34795.0\n", + " 297058.0\n", " private_auto\n", - " 4.0\n", - " 55673.0\n", - " one\n", + " 2.0\n", + " 380443.0\n", + " two\n", " core\n", - " naics22\n", - " single_family\n", + " naics62\n", + " multiple_units\n", " not_attending_school\n", - " some_college\n", + " bachelors_degree\n", " owner\n", " english\n", - " 1 (Tract 438.21, Riverside, CA)\n", - " 438.21 (Riverside, CA)\n", - " Riverside County, CA\n", + " 1 (Tract 2643.05, Los Angeles, CA)\n", + " 2643.05 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", " California\n", - " 1 (Tract 1318.01, Los Angeles, CA)\n", - " 1318.01 (Los Angeles, CA)\n", + " 3 (Tract 9105.01, Los Angeles, CA)\n", + " 9105.01 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", " \n", " \n", - " 328590\n", - " 14666837256321883364\n", - " 2 (Tract 998.03, Orange, CA)\n", - " 998.03 (Orange, CA)\n", - " Orange County, CA\n", + " 245631\n", + " 12533923940243185590\n", + " 2 (Tract 6203.03, Los Angeles, CA)\n", + " 6203.03 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", " California\n", - " 1 (Tract 19.09, Santa Barbara, CA)\n", - " 19.09 (Santa Barbara, CA)\n", + " 1 (Tract 29.14, Santa Barbara, CA)\n", + " 29.14 (Santa Barbara, CA)\n", " Santa Barbara County, CA\n", " California\n", " private_auto\n", - " work_from_home\n", + " home\n", " shop\n", - " 12:24:00\n", - " 15:32:30\n", - " 188\n", - " 160.0\n", + " 17:30:40\n", + " 19:53:16\n", + " 142\n", + " 110.3\n", " unknown_vehicle_type\n", " other_non_bev\n", " NaN\n", @@ -290,56 +302,56 @@ " NaN\n", " retail\n", " retail\n", - " single_family\n", - " single_family\n", - " 5402040356397900220\n", - " 4942241964108899252\n", - " 28.0\n", - " female\n", + " multi_family\n", + " multi_family\n", + " 15212051208025649622\n", + " 13620258903763937995\n", + " 69.0\n", + " male\n", " white_not_hispanic_or_latino\n", " employed\n", - " remote\n", - " 35958.0\n", - " worked_from_home\n", - " 5.0\n", - " 163983.0\n", - " three_plus\n", + " in_person\n", + " 46394.0\n", + " private_auto\n", + " 1.0\n", + " 46394.0\n", + " one\n", " core\n", - " naics71\n", - " single_family\n", + " naics515210\n", + " multiple_units\n", " not_attending_school\n", " bachelors_degree\n", - " owner\n", + " renter\n", " english\n", - " 1 (Tract 19.09, Santa Barbara, CA)\n", - " 19.09 (Santa Barbara, CA)\n", + " 1 (Tract 29.14, Santa Barbara, CA)\n", + " 29.14 (Santa Barbara, CA)\n", " Santa Barbara County, CA\n", " California\n", - " 1 (Tract 19.09, Santa Barbara, CA)\n", - " 19.09 (Santa Barbara, CA)\n", - " Santa Barbara County, CA\n", + " 1 (Tract 6204, Los Angeles, CA)\n", + " 6204 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", " California\n", " \n", " \n", - " 290226\n", - " 6303854229292462293\n", - " 1 (Tract 106.03, San Luis Obispo, CA)\n", - " 106.03 (San Luis Obispo, CA)\n", - " San Luis Obispo County, CA\n", + " 258108\n", + " 15822036852902980413\n", + " 1 (Tract 2643.06, Los Angeles, CA)\n", + " 2643.06 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", " California\n", - " 1 (Tract 6509.03, Los Angeles, CA)\n", - " 6509.03 (Los Angeles, CA)\n", + " 1 (Tract 1043.21, Los Angeles, CA)\n", + " 1043.21 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " auto_passenger\n", + " private_auto\n", " home\n", - " shop\n", - " 15:24:20\n", - " 19:41:43\n", - " 257\n", - " 224.4\n", + " work\n", + " 14:52:00\n", + " 15:40:55\n", + " 48\n", + " 19.9\n", " unknown_vehicle_type\n", - " unknown_fuel_type\n", + " other_non_bev\n", " NaN\n", " NaN\n", " NaN\n", @@ -347,52 +359,52 @@ " retail\n", " multi_family\n", " multi_family\n", - " 13705864138876697547\n", - " 7987282472985111966\n", - " 64.0\n", - " female\n", - " two_races_not_hispanic_or_latino\n", - " not_in_labor_force\n", - " unemployed_under_16_not_in_labor_force\n", - " 16702.0\n", - " other_travel_mode\n", - " 1.0\n", - " 16702.0\n", - " one\n", + " 18024054114643477512\n", + " 4390175249257531498\n", + " 32.0\n", + " male\n", + " hispanic_or_latino_origin\n", + " employed\n", + " in_person\n", + " 12507.0\n", + " private_auto\n", + " 2.0\n", + " 56284.0\n", + " two\n", " core\n", - " not_working\n", - " several_units\n", + " naics23\n", + " multiple_units\n", " not_attending_school\n", - " high_school\n", + " k_12\n", " renter\n", - " english\n", - " 1 (Tract 6509.03, Los Angeles, CA)\n", - " 6509.03 (Los Angeles, CA)\n", + " spanish\n", + " 1 (Tract 1043.21, Los Angeles, CA)\n", + " 1043.21 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", + " California\n", + " 1 (Tract 2643.06, Los Angeles, CA)\n", + " 2643.06 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " Does not have work/school location\n", - " Does not have work/school location\n", - " Does not have work/school location\n", - " Does not have work/school location\n", " \n", " \n", - " 413489\n", - " 12723186925736532275\n", - " 2 (Tract 1317.01, Los Angeles, CA)\n", - " 1317.01 (Los Angeles, CA)\n", + " 146285\n", + " 14712612269617851560\n", + " 1 (Tract 1112.01, Los Angeles, CA)\n", + " 1112.01 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " 2 (Tract 5703.04, Los Angeles, CA)\n", - " 5703.04 (Los Angeles, CA)\n", + " 1 (Tract 2653.01, Los Angeles, CA)\n", + " 2653.01 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", " private_auto\n", - " home\n", - " shop\n", - " 12:12:21\n", - " 13:13:05\n", - " 60\n", - " 40.4\n", + " school\n", + " eat\n", + " 07:59:00\n", + " 08:49:01\n", + " 50\n", + " 17.9\n", " unknown_vehicle_type\n", " other_non_bev\n", " NaN\n", @@ -400,88 +412,88 @@ " NaN\n", " retail\n", " retail\n", - " single_family\n", - " single_family\n", - " 17172255951273845098\n", - " 13489536815411746024\n", - " 27.0\n", - " female\n", + " education\n", + " education\n", + " 6730005140840342218\n", + " 8465342313702012328\n", + " 20.0\n", + " male\n", " hispanic_or_latino_origin\n", " not_in_labor_force\n", " unemployed_under_16_not_in_labor_force\n", " 0.0\n", " other_travel_mode\n", " 3.0\n", - " 41755.0\n", - " one\n", + " 5211.0\n", + " two\n", " core\n", " not_working\n", - " single_family\n", - " not_attending_school\n", - " high_school\n", + " multiple_units\n", + " undergraduate\n", + " some_college\n", " renter\n", " spanish\n", - " 2 (Tract 5703.04, Los Angeles, CA)\n", - " 5703.04 (Los Angeles, CA)\n", + " 1 (Tract 2653.04, Los Angeles, CA)\n", + " 2653.04 (Los Angeles, CA)\n", + " Los Angeles County, CA\n", + " California\n", + " 1 (Tract 2653.01, Los Angeles, CA)\n", + " 2653.01 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " Does not have work/school location\n", - " Does not have work/school location\n", - " Does not have work/school location\n", - " Does not have work/school location\n", " \n", " \n", - " 200732\n", - " 3756333795244641657\n", - " 2 (Tract 1897.04, Los Angeles, CA)\n", - " 1897.04 (Los Angeles, CA)\n", + " 58235\n", + " 16619945285298383268\n", + " 1 (Tract 5436.07, Los Angeles, CA)\n", + " 5436.07 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " 2 (Tract 2712, Los Angeles, CA)\n", - " 2712 (Los Angeles, CA)\n", + " 1 (Tract 1321.02, Los Angeles, CA)\n", + " 1321.02 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", " private_auto\n", - " home\n", " work\n", - " 16:23:00\n", - " 16:58:27\n", - " 35\n", - " 19.3\n", + " home\n", + " 12:39:00\n", + " 13:28:17\n", + " 49\n", + " 34.9\n", " unknown_vehicle_type\n", " other_non_bev\n", " NaN\n", " NaN\n", " NaN\n", + " single_family\n", + " single_family\n", " retail\n", " retail\n", - " mixed_use\n", - " multi_family\n", - " 17606560948757328745\n", - " 9302417848933522777\n", - " 28.0\n", + " 14684325219070757087\n", + " 7566196984556086662\n", + " 64.0\n", " male\n", - " hispanic_or_latino_origin\n", + " asian_not_hispanic_or_latino\n", " employed\n", " in_person\n", - " 34807.0\n", + " 83858.0\n", " private_auto\n", - " 2.0\n", - " 104979.0\n", - " two\n", + " 1.0\n", + " 83858.0\n", + " one\n", " core\n", - " naics722511\n", - " multiple_units\n", + " naics44_45\n", + " several_units\n", " not_attending_school\n", - " advanced_degree\n", - " renter\n", - " english\n", - " 2 (Tract 2712, Los Angeles, CA)\n", - " 2712 (Los Angeles, CA)\n", + " some_college\n", + " owner\n", + " asian_pacific\n", + " 1 (Tract 5436.07, Los Angeles, CA)\n", + " 5436.07 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", - " 2 (Tract 1897.04, Los Angeles, CA)\n", - " 1897.04 (Los Angeles, CA)\n", + " 1 (Tract 1321.02, Los Angeles, CA)\n", + " 1321.02 (Los Angeles, CA)\n", " Los Angeles County, CA\n", " California\n", " \n", @@ -490,169 +502,155 @@ "" ], "text/plain": [ - " activity_id origin_bgrp_2020 \\\n", - "177890 15350592806243147042 1 (Tract 438.21, Riverside, CA) \n", - "328590 14666837256321883364 2 (Tract 998.03, Orange, CA) \n", - "290226 6303854229292462293 1 (Tract 106.03, San Luis Obispo, CA) \n", - "413489 12723186925736532275 2 (Tract 1317.01, Los Angeles, CA) \n", - "200732 3756333795244641657 2 (Tract 1897.04, Los Angeles, CA) \n", - "\n", - " origin_trct_2020 origin_cty_2020 \\\n", - "177890 438.21 (Riverside, CA) Riverside County, CA \n", - "328590 998.03 (Orange, CA) Orange County, CA \n", - "290226 106.03 (San Luis Obispo, CA) San Luis Obispo County, CA \n", - "413489 1317.01 (Los Angeles, CA) Los Angeles County, CA \n", - "200732 1897.04 (Los Angeles, CA) Los Angeles County, CA \n", - "\n", - " origin_st_2020 destination_bgrp_2020 \\\n", - "177890 California 1 (Tract 1318.01, Los Angeles, CA) \n", - "328590 California 1 (Tract 19.09, Santa Barbara, CA) \n", - "290226 California 1 (Tract 6509.03, Los Angeles, CA) \n", - "413489 California 2 (Tract 5703.04, Los Angeles, CA) \n", - "200732 California 2 (Tract 2712, Los Angeles, CA) \n", - "\n", - " destination_trct_2020 destination_cty_2020 \\\n", - "177890 1318.01 (Los Angeles, CA) Los Angeles County, CA \n", - "328590 19.09 (Santa Barbara, CA) Santa Barbara County, CA \n", - "290226 6509.03 (Los Angeles, CA) Los Angeles County, CA \n", - "413489 5703.04 (Los Angeles, CA) Los Angeles County, CA \n", - "200732 2712 (Los Angeles, CA) Los Angeles County, CA \n", - "\n", - " destination_st_2020 primary_mode trip_purpose \\\n", - "177890 California private_auto work \n", - "328590 California private_auto work_from_home \n", - "290226 California auto_passenger home \n", - "413489 California private_auto home \n", - "200732 California private_auto home \n", + " activity_id origin_bgrp_2020 \\\n", + "423350 5926084662673022461 1 (Tract 2643.05, Los Angeles, CA) \n", + "245631 12533923940243185590 2 (Tract 6203.03, Los Angeles, CA) \n", + "258108 15822036852902980413 1 (Tract 2643.06, Los Angeles, CA) \n", + "146285 14712612269617851560 1 (Tract 1112.01, Los Angeles, CA) \n", + "58235 16619945285298383268 1 (Tract 5436.07, Los Angeles, CA) \n", "\n", - " previous_trip_purpose trip_start_time trip_end_time \\\n", - "177890 home 16:50:00 19:36:15 \n", - "328590 shop 12:24:00 15:32:30 \n", - "290226 shop 15:24:20 19:41:43 \n", - "413489 shop 12:12:21 13:13:05 \n", - "200732 work 16:23:00 16:58:27 \n", + " origin_trct_2020 origin_cty_2020 origin_st_2020 \\\n", + "423350 2643.05 (Los Angeles, CA) Los Angeles County, CA California \n", + "245631 6203.03 (Los Angeles, CA) Los Angeles County, CA California \n", + "258108 2643.06 (Los Angeles, CA) Los Angeles County, CA California \n", + "146285 1112.01 (Los Angeles, CA) Los Angeles County, CA California \n", + "58235 5436.07 (Los Angeles, CA) Los Angeles County, CA California \n", + "\n", + " destination_bgrp_2020 destination_trct_2020 \\\n", + "423350 3 (Tract 9105.01, Los Angeles, CA) 9105.01 (Los Angeles, CA) \n", + "245631 1 (Tract 29.14, Santa Barbara, CA) 29.14 (Santa Barbara, CA) \n", + "258108 1 (Tract 1043.21, Los Angeles, CA) 1043.21 (Los Angeles, CA) \n", + "146285 1 (Tract 2653.01, Los Angeles, CA) 2653.01 (Los Angeles, CA) \n", + "58235 1 (Tract 1321.02, Los Angeles, CA) 1321.02 (Los Angeles, CA) \n", + "\n", + " destination_cty_2020 destination_st_2020 primary_mode \\\n", + "423350 Los Angeles County, CA California private_auto \n", + "245631 Santa Barbara County, CA California private_auto \n", + "258108 Los Angeles County, CA California private_auto \n", + "146285 Los Angeles County, CA California private_auto \n", + "58235 Los Angeles County, CA California private_auto \n", + "\n", + " trip_purpose previous_trip_purpose trip_start_time trip_end_time \\\n", + "423350 work home 14:57:00 16:25:56 \n", + "245631 home shop 17:30:40 19:53:16 \n", + "258108 home work 14:52:00 15:40:55 \n", + "146285 school eat 07:59:00 08:49:01 \n", + "58235 work home 12:39:00 13:28:17 \n", "\n", " trip_duration_minutes trip_distance_miles vehicle_type \\\n", - "177890 166 108.7 unknown_vehicle_type \n", - "328590 188 160.0 unknown_vehicle_type \n", - "290226 257 224.4 unknown_vehicle_type \n", - "413489 60 40.4 unknown_vehicle_type \n", - "200732 35 19.3 unknown_vehicle_type \n", - "\n", - " vehicle_fuel_type transit_submode transit_agency transit_route \\\n", - "177890 other_non_bev NaN NaN NaN \n", - "328590 other_non_bev NaN NaN NaN \n", - "290226 unknown_fuel_type NaN NaN NaN \n", - "413489 other_non_bev NaN NaN NaN \n", - "200732 other_non_bev NaN NaN NaN \n", + "423350 88 57.2 unknown_vehicle_type \n", + "245631 142 110.3 unknown_vehicle_type \n", + "258108 48 19.9 unknown_vehicle_type \n", + "146285 50 17.9 unknown_vehicle_type \n", + "58235 49 34.9 unknown_vehicle_type \n", + "\n", + " vehicle_fuel_type transit_submode transit_agency transit_route \\\n", + "423350 other_non_bev NaN NaN NaN \n", + "245631 other_non_bev NaN NaN NaN \n", + "258108 other_non_bev NaN NaN NaN \n", + "146285 other_non_bev NaN NaN NaN \n", + "58235 other_non_bev NaN NaN NaN \n", "\n", " origin_land_use origin_building_use destination_land_use \\\n", - "177890 single_family single_family mixed_use \n", - "328590 retail retail single_family \n", - "290226 retail retail multi_family \n", - "413489 retail retail single_family \n", - "200732 retail retail mixed_use \n", + "423350 mixed_use multi_family civic_institutional \n", + "245631 retail retail multi_family \n", + "258108 retail retail multi_family \n", + "146285 retail retail education \n", + "58235 single_family single_family retail \n", "\n", " destination_building_use trip_taker_person_id trip_taker_household_id \\\n", - "177890 office 13837498645562403926 8821470648757336257 \n", - "328590 single_family 5402040356397900220 4942241964108899252 \n", - "290226 multi_family 13705864138876697547 7987282472985111966 \n", - "413489 single_family 17172255951273845098 13489536815411746024 \n", - "200732 multi_family 17606560948757328745 9302417848933522777 \n", - "\n", - " trip_taker_age trip_taker_sex trip_taker_race_ethnicity \\\n", - "177890 30.0 female aian_not_hispanic_or_latino \n", - "328590 28.0 female white_not_hispanic_or_latino \n", - "290226 64.0 female two_races_not_hispanic_or_latino \n", - "413489 27.0 female hispanic_or_latino_origin \n", - "200732 28.0 male hispanic_or_latino_origin \n", + "423350 civic_institutional 9280162199592818201 3819422246701548245 \n", + "245631 multi_family 15212051208025649622 13620258903763937995 \n", + "258108 multi_family 18024054114643477512 4390175249257531498 \n", + "146285 education 6730005140840342218 8465342313702012328 \n", + "58235 retail 14684325219070757087 7566196984556086662 \n", + "\n", + " trip_taker_age trip_taker_sex trip_taker_race_ethnicity \\\n", + "423350 59.0 male white_not_hispanic_or_latino \n", + "245631 69.0 male white_not_hispanic_or_latino \n", + "258108 32.0 male hispanic_or_latino_origin \n", + "146285 20.0 male hispanic_or_latino_origin \n", + "58235 64.0 male asian_not_hispanic_or_latino \n", "\n", " trip_taker_employment_status trip_taker_wfh \\\n", - "177890 employed in_person \n", - "328590 employed remote \n", - "290226 not_in_labor_force unemployed_under_16_not_in_labor_force \n", - "413489 not_in_labor_force unemployed_under_16_not_in_labor_force \n", - "200732 employed in_person \n", + "423350 employed in_person \n", + "245631 employed in_person \n", + "258108 employed in_person \n", + "146285 not_in_labor_force unemployed_under_16_not_in_labor_force \n", + "58235 employed in_person \n", "\n", " trip_taker_individual_income trip_taker_commute_mode \\\n", - "177890 34795.0 private_auto \n", - "328590 35958.0 worked_from_home \n", - "290226 16702.0 other_travel_mode \n", - "413489 0.0 other_travel_mode \n", - "200732 34807.0 private_auto \n", + "423350 297058.0 private_auto \n", + "245631 46394.0 private_auto \n", + "258108 12507.0 private_auto \n", + "146285 0.0 other_travel_mode \n", + "58235 83858.0 private_auto \n", "\n", " trip_taker_household_size trip_taker_household_income \\\n", - "177890 4.0 55673.0 \n", - "328590 5.0 163983.0 \n", - "290226 1.0 16702.0 \n", - "413489 3.0 41755.0 \n", - "200732 2.0 104979.0 \n", + "423350 2.0 380443.0 \n", + "245631 1.0 46394.0 \n", + "258108 2.0 56284.0 \n", + "146285 3.0 5211.0 \n", + "58235 1.0 83858.0 \n", "\n", " trip_taker_available_vehicles trip_taker_resident_type \\\n", - "177890 one core \n", - "328590 three_plus core \n", - "290226 one core \n", - "413489 one core \n", - "200732 two core \n", + "423350 two core \n", + "245631 one core \n", + "258108 two core \n", + "146285 two core \n", + "58235 one core \n", "\n", " trip_taker_industry trip_taker_building_type \\\n", - "177890 naics22 single_family \n", - "328590 naics71 single_family \n", - "290226 not_working several_units \n", - "413489 not_working single_family \n", - "200732 naics722511 multiple_units \n", + "423350 naics62 multiple_units \n", + "245631 naics515210 multiple_units \n", + "258108 naics23 multiple_units \n", + "146285 not_working multiple_units \n", + "58235 naics44_45 several_units \n", "\n", " trip_taker_school_grade_attending trip_taker_education \\\n", - "177890 not_attending_school some_college \n", - "328590 not_attending_school bachelors_degree \n", - "290226 not_attending_school high_school \n", - "413489 not_attending_school high_school \n", - "200732 not_attending_school advanced_degree \n", + "423350 not_attending_school bachelors_degree \n", + "245631 not_attending_school bachelors_degree \n", + "258108 not_attending_school k_12 \n", + "146285 undergraduate some_college \n", + "58235 not_attending_school some_college \n", "\n", " trip_taker_tenure trip_taker_language \\\n", - "177890 owner english \n", - "328590 owner english \n", - "290226 renter english \n", - "413489 renter spanish \n", - "200732 renter english \n", + "423350 owner english \n", + "245631 renter english \n", + "258108 renter spanish \n", + "146285 renter spanish \n", + "58235 owner asian_pacific \n", "\n", " trip_taker_home_bgrp_2020 trip_taker_home_trct_2020 \\\n", - "177890 1 (Tract 438.21, Riverside, CA) 438.21 (Riverside, CA) \n", - "328590 1 (Tract 19.09, Santa Barbara, CA) 19.09 (Santa Barbara, CA) \n", - "290226 1 (Tract 6509.03, Los Angeles, CA) 6509.03 (Los Angeles, CA) \n", - "413489 2 (Tract 5703.04, Los Angeles, CA) 5703.04 (Los Angeles, CA) \n", - "200732 2 (Tract 2712, Los Angeles, CA) 2712 (Los Angeles, CA) \n", + "423350 1 (Tract 2643.05, Los Angeles, CA) 2643.05 (Los Angeles, CA) \n", + "245631 1 (Tract 29.14, Santa Barbara, CA) 29.14 (Santa Barbara, CA) \n", + "258108 1 (Tract 1043.21, Los Angeles, CA) 1043.21 (Los Angeles, CA) \n", + "146285 1 (Tract 2653.04, Los Angeles, CA) 2653.04 (Los Angeles, CA) \n", + "58235 1 (Tract 5436.07, Los Angeles, CA) 5436.07 (Los Angeles, CA) \n", "\n", " trip_taker_home_cty_2020 trip_taker_home_st_2020 \\\n", - "177890 Riverside County, CA California \n", - "328590 Santa Barbara County, CA California \n", - "290226 Los Angeles County, CA California \n", - "413489 Los Angeles County, CA California \n", - "200732 Los Angeles County, CA California \n", - "\n", - " trip_taker_work_bgrp_2020 \\\n", - "177890 1 (Tract 1318.01, Los Angeles, CA) \n", - "328590 1 (Tract 19.09, Santa Barbara, CA) \n", - "290226 Does not have work/school location \n", - "413489 Does not have work/school location \n", - "200732 2 (Tract 1897.04, Los Angeles, CA) \n", - "\n", - " trip_taker_work_trct_2020 \\\n", - "177890 1318.01 (Los Angeles, CA) \n", - "328590 19.09 (Santa Barbara, CA) \n", - "290226 Does not have work/school location \n", - "413489 Does not have work/school location \n", - "200732 1897.04 (Los Angeles, CA) \n", - "\n", - " trip_taker_work_cty_2020 trip_taker_work_st_2020 \n", - "177890 Los Angeles County, CA California \n", - "328590 Santa Barbara County, CA California \n", - "290226 Does not have work/school location Does not have work/school location \n", - "413489 Does not have work/school location Does not have work/school location \n", - "200732 Los Angeles County, CA California " + "423350 Los Angeles County, CA California \n", + "245631 Santa Barbara County, CA California \n", + "258108 Los Angeles County, CA California \n", + "146285 Los Angeles County, CA California \n", + "58235 Los Angeles County, CA California \n", + "\n", + " trip_taker_work_bgrp_2020 trip_taker_work_trct_2020 \\\n", + "423350 3 (Tract 9105.01, Los Angeles, CA) 9105.01 (Los Angeles, CA) \n", + "245631 1 (Tract 6204, Los Angeles, CA) 6204 (Los Angeles, CA) \n", + "258108 1 (Tract 2643.06, Los Angeles, CA) 2643.06 (Los Angeles, CA) \n", + "146285 1 (Tract 2653.01, Los Angeles, CA) 2653.01 (Los Angeles, CA) \n", + "58235 1 (Tract 1321.02, Los Angeles, CA) 1321.02 (Los Angeles, CA) \n", + "\n", + " trip_taker_work_cty_2020 trip_taker_work_st_2020 \n", + "423350 Los Angeles County, CA California \n", + "245631 Los Angeles County, CA California \n", + "258108 Los Angeles County, CA California \n", + "146285 Los Angeles County, CA California \n", + "58235 Los Angeles County, CA California " ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -671,7 +669,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "id": "75945ef2-eab7-469a-baad-ee563d70c309", "metadata": {}, "outputs": [ @@ -694,7 +692,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "id": "1f3e4cbb-d211-40b1-b4bb-2c7cb43b33a9", "metadata": {}, "outputs": [ @@ -725,7 +723,7 @@ " dtype='object')" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -770,7 +768,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "id": "d7f3b44a-cd77-42e9-b0d8-7b9d228b37d5", "metadata": {}, "outputs": [], @@ -781,7 +779,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "id": "05893215-e993-44dc-9c4b-1aa7d94815cd", "metadata": {}, "outputs": [ @@ -790,23 +788,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 71, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -2479,7 +3046,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 56, "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", "metadata": {}, "outputs": [ @@ -2553,7 +3120,7 @@ "1 Metro - Los Angeles" ] }, - "execution_count": 72, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -2582,7 +3149,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 57, "id": "8af03d60-4537-44d3-b82f-d857625e47c3", "metadata": {}, "outputs": [], @@ -2608,7 +3175,7 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 58, "id": "6951b590-cef8-44bd-b27d-0b18893609c5", "metadata": {}, "outputs": [], @@ -2618,7 +3185,7 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": 59, "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", "metadata": {}, "outputs": [], @@ -2628,7 +3195,7 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": 60, "id": "814dde3a-d303-4044-9df1-464e408bf460", "metadata": {}, "outputs": [], @@ -2638,7 +3205,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 61, "id": "84174911-2243-430c-ab73-1fecb2552094", "metadata": {}, "outputs": [], @@ -2648,7 +3215,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 62, "id": "202923d2-b869-4a72-8a02-ce229a65d815", "metadata": {}, "outputs": [ @@ -2656,7 +3223,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_798/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/tmp/ipykernel_515/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } @@ -2667,7 +3234,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 63, "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", "metadata": {}, "outputs": [], @@ -2677,7 +3244,7 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 64, "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], @@ -2687,7 +3254,7 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": 65, "id": "f1267faf-e28c-4208-ae79-43b31f67f705", "metadata": {}, "outputs": [], @@ -2697,7 +3264,7 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 66, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, "outputs": [ @@ -2706,23 +3273,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 55, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -3046,7 +2833,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 54, "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", "metadata": {}, "outputs": [ @@ -3120,7 +2907,7 @@ "1 Metro - Los Angeles" ] }, - "execution_count": 56, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -3149,102 +2936,179 @@ }, { "cell_type": "code", - "execution_count": 57, - "id": "8af03d60-4537-44d3-b82f-d857625e47c3", - "metadata": {}, - "outputs": [], - "source": [ - "columns_to_keep = [\"AVTA\",\n", - " \"Beach Cities Transit-City of Redondo Beach\",\n", - " \"LADOT126\",\n", - " \"Metro - Los Angeles\",\n", - " \"LA Go Bus\",\n", - " \"LADOTDT\",\n", - " \"Amtrak\",\n", - " \"Big Blue Bus\",\n", - " \"GTrans\",\n", - " \"LADOTMVN\",\n", - " \"Long Beach Transit\",\n", - " \"Santa Clarita Transit\",\n", - " \"Foothill Transit\",\n", - " \"Culver CityBus\",\n", - " \"Metrolink Trains\",\n", - " \"LADOTMVS\"\n", - " ]" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "id": "6951b590-cef8-44bd-b27d-0b18893609c5", - "metadata": {}, - "outputs": [], - "source": [ - "# agency_indv_count.sample()" - ] - }, - { - "cell_type": "code", - "execution_count": 59, - "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", - "metadata": {}, - "outputs": [], - "source": [ - "df_agencies = agency_indv_count.loc[:, columns_to_keep]" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "id": "814dde3a-d303-4044-9df1-464e408bf460", - "metadata": {}, - "outputs": [], - "source": [ - "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" - ] - }, - { - "cell_type": "code", - "execution_count": 61, - "id": "84174911-2243-430c-ab73-1fecb2552094", + "execution_count": null, + "id": "febd910a-2f1d-4b99-bb3b-76adb11f0b63", "metadata": {}, "outputs": [], - "source": [ - "# df_agencies" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 62, - "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "execution_count": 55, + "id": "96b794f2-bcfd-4afb-9ce5-8793c15fe199", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_515/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/home/jovyan/data-analyses/sb125_analyses/corridor_study/_utils.py:98: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } ], "source": [ - "df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" + "df_agencies = _utils.get_agencies_occurances(df)" ] }, { "cell_type": "code", - "execution_count": 63, - "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", + "execution_count": 56, + "id": "80cbffde-6686-4921-b543-84e52f97a0c5", "metadata": {}, - "outputs": [], + "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", + "
agencyn_trips
0Culver CityBus28
1Foothill Transit1
2LA Go Bus1
3Metro - Los Angeles195
4Amtrak8
5AVTA4
6GTrans1
7Metrolink Trains1
8LADOTMVN54
9Long Beach Transit1
10Santa Clarita Transit28
11LADOTDT3
12Big Blue Bus37
13LADOT1264
14LADOTMVS4
15Beach Cities Transit-City of Redondo Beach2
\n", + "
" + ], + "text/plain": [ + " agency n_trips\n", + "0 Culver CityBus 28\n", + "1 Foothill Transit 1\n", + "2 LA Go Bus 1\n", + "3 Metro - Los Angeles 195\n", + "4 Amtrak 8\n", + "5 AVTA 4\n", + "6 GTrans 1\n", + "7 Metrolink Trains 1\n", + "8 LADOTMVN 54\n", + "9 Long Beach Transit 1\n", + "10 Santa Clarita Transit 28\n", + "11 LADOTDT 3\n", + "12 Big Blue Bus 37\n", + "13 LADOT126 4\n", + "14 LADOTMVS 4\n", + "15 Beach Cities Transit-City of Redondo Beach 2" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "df_agencies = df_agencies>>select(_.agency, _.n_trips)" + "df_agencies" ] }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 57, "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], @@ -3254,17 +3118,7 @@ }, { "cell_type": "code", - "execution_count": 65, - "id": "f1267faf-e28c-4208-ae79-43b31f67f705", - "metadata": {}, - "outputs": [], - "source": [ - "# df_agencies" - ] - }, - { - "cell_type": "code", - "execution_count": 66, + "execution_count": 59, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, "outputs": [ @@ -3273,23 +3127,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 66, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -3372,7 +3226,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 60, "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", "metadata": {}, "outputs": [ @@ -3395,7 +3249,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 61, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -3408,7 +3262,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 62, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -3531,7 +3385,7 @@ "11 public_transit visitor 56" ] }, - "execution_count": 69, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } @@ -3542,7 +3396,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 63, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -3551,23 +3405,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 74, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -2486,7 +2196,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 48, "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", "metadata": {}, "outputs": [ @@ -2560,131 +2270,206 @@ "75 AC TRANSIT, San Francisco Municipal Transportation Agency" ] }, - "execution_count": 75, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "display(HTML(\"

Most Common Agency Combination

\")) \n", - "\n", - "(df>>arrange(-_.n)>>select(_.transit_agency)).head(5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "786394ef-be26-4e0d-94e7-35386d6d67c0", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fd43ab95-0391-407b-b6b0-185034ba9528", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 76, - "id": "8af03d60-4537-44d3-b82f-d857625e47c3", - "metadata": {}, - "outputs": [], - "source": [ - "columns_to_keep = [\"AC TRANSIT\",\n", - " \"San Francisco Bay Ferry\",\n", - " \"SolTrans\",\n", - " \"Caltrain\",\n", - " \"SamTrans\",\n", - " \"The S\",\n", - " \"Fairfield and Suisun Transit\",\n", - " \"Sacramento Regional Transit\",\n", - " \"Marin Transit\",\n", - " \"Tri Delta Transit\",\n", - " \"San Francisco Municipal Transportation Agency\",\n", - " \"Amtrak\",\n", - " \"San Joaquin Regional Transit District (RTD)\",\n", - " \"Bay Area Rapid Transit\",\n", - " \"Santa Cruz Metro\",\n", - " \"VTA\"\n", - " ]" - ] - }, - { - "cell_type": "code", - "execution_count": 77, - "id": "6951b590-cef8-44bd-b27d-0b18893609c5", - "metadata": {}, - "outputs": [], - "source": [ - "# agency_indv_count.sample()" - ] - }, - { - "cell_type": "code", - "execution_count": 78, - "id": "cca56d58-5e3f-430c-adde-15ca665d46f8", - "metadata": {}, - "outputs": [], - "source": [ - "df_agencies = agency_indv_count.loc[:, columns_to_keep]" + "display(HTML(\"

Most Common Agency Combination

\")) \n", + "\n", + "(df>>arrange(-_.n)>>select(_.transit_agency)).head(5)" ] }, { "cell_type": "code", - "execution_count": 79, - "id": "814dde3a-d303-4044-9df1-464e408bf460", + "execution_count": null, + "id": "786394ef-be26-4e0d-94e7-35386d6d67c0", "metadata": {}, "outputs": [], - "source": [ - "df_agencies = pd.DataFrame(df_agencies).transpose().reset_index().rename(columns={'index':'agency'})" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 80, - "id": "84174911-2243-430c-ab73-1fecb2552094", + "execution_count": null, + "id": "fd43ab95-0391-407b-b6b0-185034ba9528", "metadata": {}, "outputs": [], - "source": [ - "# df_agencies" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 81, - "id": "202923d2-b869-4a72-8a02-ce229a65d815", + "execution_count": 49, + "id": "8af03d60-4537-44d3-b82f-d857625e47c3", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_634/2517619377.py:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/home/jovyan/data-analyses/sb125_analyses/corridor_study/_utils.py:102: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } ], "source": [ - "df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)" + "df_agencies = _utils.get_agencies_occurances(df)" ] }, { "cell_type": "code", - "execution_count": 82, - "id": "2b31eb23-e1e6-43c6-8b0e-ccb3802cd09d", + "execution_count": 50, + "id": "6951b590-cef8-44bd-b27d-0b18893609c5", "metadata": {}, - "outputs": [], + "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", + "
agencyn_trips
0Sacramento Regional Transit6
1SamTrans19
2nan1
3The S3
4San Francisco Municipal Transportation Agency175
5Caltrain20
6Marin Transit1
7Tri Delta Transit1
8Santa Cruz Metro1
9VTA16
10Fairfield and Suisun Transit1
11San Joaquin Regional Transit District (RTD)0
12SolTrans29
13San Francisco Bay Ferry3
14AC TRANSIT111
15Bay Area Rapid Transit37
16Amtrak10
\n", + "
" + ], + "text/plain": [ + " agency n_trips\n", + "0 Sacramento Regional Transit 6\n", + "1 SamTrans 19\n", + "2 nan 1\n", + "3 The S 3\n", + "4 San Francisco Municipal Transportation Agency 175\n", + "5 Caltrain 20\n", + "6 Marin Transit 1\n", + "7 Tri Delta Transit 1\n", + "8 Santa Cruz Metro 1\n", + "9 VTA 16\n", + "10 Fairfield and Suisun Transit 1\n", + "11 San Joaquin Regional Transit District (RTD) 0\n", + "12 SolTrans 29\n", + "13 San Francisco Bay Ferry 3\n", + "14 AC TRANSIT 111\n", + "15 Bay Area Rapid Transit 37\n", + "16 Amtrak 10" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "df_agencies = df_agencies>>select(_.agency, _.n_trips)" + "df_agencies" ] }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 51, "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], @@ -2694,7 +2479,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 52, "id": "f1267faf-e28c-4208-ae79-43b31f67f705", "metadata": {}, "outputs": [], @@ -2704,7 +2489,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 53, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, "outputs": [ @@ -2713,23 +2498,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 85, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -2820,7 +2605,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 54, "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", "metadata": {}, "outputs": [ @@ -2843,7 +2628,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 55, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -2856,7 +2641,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 56, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -2958,7 +2743,7 @@ "8 public_transit visitor 47" ] }, - "execution_count": 88, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -2969,7 +2754,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 57, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -2978,23 +2763,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 53, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -2833,7 +2900,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 57, "id": "60df338f-801f-49a1-a26f-0be5e03bddf3", "metadata": {}, "outputs": [ @@ -2907,7 +2974,7 @@ "1 Metro - Los Angeles" ] }, - "execution_count": 54, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -2944,7 +3011,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 58, "id": "96b794f2-bcfd-4afb-9ce5-8793c15fe199", "metadata": {}, "outputs": [ @@ -2952,7 +3019,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/jovyan/data-analyses/sb125_analyses/corridor_study/_utils.py:98: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", + "/home/jovyan/data-analyses/sb125_analyses/corridor_study/_utils.py:102: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n", " df_agencies['n_trips'] = df_agencies[list(df_agencies.columns)].sum(axis=1)\n" ] } @@ -2963,7 +3030,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 59, "id": "80cbffde-6686-4921-b543-84e52f97a0c5", "metadata": {}, "outputs": [ @@ -2995,83 +3062,83 @@ " \n", " \n", " 0\n", - " Culver CityBus\n", - " 28\n", + " Foothill Transit\n", + " 1\n", " \n", " \n", " 1\n", - " Foothill Transit\n", - " 1\n", + " LADOTMVS\n", + " 4\n", " \n", " \n", " 2\n", - " LA Go Bus\n", - " 1\n", + " LADOTMVN\n", + " 54\n", " \n", " \n", " 3\n", - " Metro - Los Angeles\n", - " 195\n", + " AVTA\n", + " 4\n", " \n", " \n", " 4\n", - " Amtrak\n", - " 8\n", + " Beach Cities Transit-City of Redondo Beach\n", + " 2\n", " \n", " \n", " 5\n", - " AVTA\n", - " 4\n", + " Metro - Los Angeles\n", + " 195\n", " \n", " \n", " 6\n", - " GTrans\n", + " Long Beach Transit\n", " 1\n", " \n", " \n", " 7\n", - " Metrolink Trains\n", - " 1\n", + " LADOT126\n", + " 4\n", " \n", " \n", " 8\n", - " LADOTMVN\n", - " 54\n", + " Santa Clarita Transit\n", + " 28\n", " \n", " \n", " 9\n", - " Long Beach Transit\n", + " Metrolink Trains\n", " 1\n", " \n", " \n", " 10\n", - " Santa Clarita Transit\n", - " 28\n", + " LADOTDT\n", + " 3\n", " \n", " \n", " 11\n", - " LADOTDT\n", - " 3\n", + " Culver CityBus\n", + " 28\n", " \n", " \n", " 12\n", - " Big Blue Bus\n", - " 37\n", + " GTrans\n", + " 1\n", " \n", " \n", " 13\n", - " LADOT126\n", - " 4\n", + " Amtrak\n", + " 8\n", " \n", " \n", " 14\n", - " LADOTMVS\n", - " 4\n", + " LA Go Bus\n", + " 1\n", " \n", " \n", " 15\n", - " Beach Cities Transit-City of Redondo Beach\n", - " 2\n", + " Big Blue Bus\n", + " 37\n", " \n", " \n", "\n", @@ -3079,25 +3146,25 @@ ], "text/plain": [ " agency n_trips\n", - "0 Culver CityBus 28\n", - "1 Foothill Transit 1\n", - "2 LA Go Bus 1\n", - "3 Metro - Los Angeles 195\n", - "4 Amtrak 8\n", - "5 AVTA 4\n", - "6 GTrans 1\n", - "7 Metrolink Trains 1\n", - "8 LADOTMVN 54\n", - "9 Long Beach Transit 1\n", - "10 Santa Clarita Transit 28\n", - "11 LADOTDT 3\n", - "12 Big Blue Bus 37\n", - "13 LADOT126 4\n", - "14 LADOTMVS 4\n", - "15 Beach Cities Transit-City of Redondo Beach 2" + "0 Foothill Transit 1\n", + "1 LADOTMVS 4\n", + "2 LADOTMVN 54\n", + "3 AVTA 4\n", + "4 Beach Cities Transit-City of Redondo Beach 2\n", + "5 Metro - Los Angeles 195\n", + "6 Long Beach Transit 1\n", + "7 LADOT126 4\n", + "8 Santa Clarita Transit 28\n", + "9 Metrolink Trains 1\n", + "10 LADOTDT 3\n", + "11 Culver CityBus 28\n", + "12 GTrans 1\n", + "13 Amtrak 8\n", + "14 LA Go Bus 1\n", + "15 Big Blue Bus 37" ] }, - "execution_count": 56, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -3108,7 +3175,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 60, "id": "f98c76b9-b83f-42c3-aa12-702ade72ac38", "metadata": {}, "outputs": [], @@ -3118,7 +3185,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 61, "id": "bf160b81-1bc2-4374-9529-6400252d5e4f", "metadata": {}, "outputs": [ @@ -3127,23 +3194,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, - "execution_count": 59, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -3226,7 +3293,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 62, "id": "16b45917-adc3-44d0-8d76-15ccd4083d26", "metadata": {}, "outputs": [ @@ -3249,7 +3316,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 63, "id": "5163926e-82bd-4c25-9486-45229d09a0d1", "metadata": {}, "outputs": [], @@ -3262,7 +3329,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 64, "id": "636e7771-0ba7-42e9-af1d-e3e998ff8599", "metadata": {}, "outputs": [ @@ -3385,7 +3452,7 @@ "11 public_transit visitor 56" ] }, - "execution_count": 62, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -3396,7 +3463,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 65, "id": "90c5d683-91c5-4663-accd-4e45027a3e49", "metadata": {}, "outputs": [ @@ -3405,23 +3472,23 @@ "text/html": [ "\n", "\n", - "
\n", + "
\n", "