Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
039719e
census data query and join with ridership data
shweta487 Mar 19, 2026
e852dbf
lehd data processing file added and acs data processing started
shweta487 Mar 19, 2026
002c767
lehd data processing file added and acs data processing started
shweta487 Mar 19, 2026
65a6799
lehd data processing file added and acs data processing started
shweta487 Mar 19, 2026
1b19e92
ridership modeling started
shweta487 Mar 19, 2026
0355655
model check
shweta487 Mar 19, 2026
8745ad5
ols, ppml and negative binomial models explored
shweta487 Mar 26, 2026
267ce0b
model exploration using 2024 acs data
shweta487 Apr 3, 2026
64f4be0
model exploration with jobs data from 2023 added
shweta487 Apr 6, 2026
add5ae2
groupby variables changed that changed the model coefficients
shweta487 Apr 9, 2026
d526398
burbank blue route and orange stops effect on ridership changes
shweta487 Apr 28, 2026
e3ef85e
more burbank details added
shweta487 Apr 28, 2026
321cef6
scatter plot added for orange county and burbank
shweta487 Apr 29, 2026
8e10c82
scatter plot added for orange county and burbank
shweta487 Apr 29, 2026
2894320
burbank model changed to show rail connection stops
shweta487 Apr 29, 2026
5991043
burbank model changed to show rail connection stops
shweta487 Apr 29, 2026
082dd99
file paths changed
shweta487 Apr 30, 2026
3525c99
new burbank ridership model only with landuse
shweta487 Apr 30, 2026
8f35972
burbank updated models
shweta487 May 6, 2026
57185c4
...
shweta487 May 11, 2026
0734159
UCSB and Burbank Ridership Estimation
shweta487 May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions ahsc_grant/ahsc_grant_cycle2/02_Stop_Route_Data_Cleaning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: shared_utils in /home/jovyan/data-analyses/_shared_utils (4.4)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
"\u001b[31mERROR: Could not find a version that satisfies the requirement shared_utils (from versions: none)\u001b[0m\u001b[31m\n",
"\u001b[0m\u001b[31mERROR: No matching distribution found for shared_utils\u001b[0m\u001b[31m\n",
"\u001b[0mNote: you may need to restart the kernel to use updated packages.\n"
]
}
],
Expand All @@ -60,7 +61,7 @@
"import gcsfs\n",
"import datetime as dt\n",
"from calitp_data_analysis.sql import get_engine\n",
"from shared_utils import gtfs_utils_v2\n",
"# from shared_utils import gtfs_utils_v2\n",
"from calitp_data_analysis import utils\n",
"db_engine = get_engine()\n",
"credentials, project = google.auth.default()\n",
Expand Down Expand Up @@ -375,6 +376,7 @@
" # n_trips=('n_trips', 'sum'),\n",
" n_arrivals = ('arrivals_all_day', 'first'),\n",
" n_routes=('route_id', 'nunique'), # number of unique route_ids per group\n",
" route_id_list=('route_id', lambda x: sorted(set(x))),\n",
" stop_code=('stop_code', 'first'),\n",
" pt_geom=('pt_geom', lambda x: next((v for v in x if pd.notna(v)), pd.NA))).reset_index()\n",
"\n",
Expand Down Expand Up @@ -406,18 +408,19 @@
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 27355 entries, 0 to 27354\n",
"Data columns (total 7 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 feed_key 27355 non-null object\n",
" 1 stop_id 27355 non-null object\n",
" 2 stop_name 27355 non-null object\n",
" 3 n_arrivals 27355 non-null int64 \n",
" 4 n_routes 27355 non-null int64 \n",
" 5 stop_code 24376 non-null object\n",
" 6 pt_geom 27355 non-null object\n",
"dtypes: int64(2), object(5)\n",
"memory usage: 1.5+ MB\n"
"Data columns (total 8 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 feed_key 27355 non-null object\n",
" 1 stop_id 27355 non-null object\n",
" 2 stop_name 27355 non-null object\n",
" 3 n_arrivals 27355 non-null int64 \n",
" 4 n_routes 27355 non-null int64 \n",
" 5 route_id_list 27355 non-null object\n",
" 6 stop_code 24376 non-null object\n",
" 7 pt_geom 27355 non-null object\n",
"dtypes: int64(2), object(6)\n",
"memory usage: 1.7+ MB\n"
]
}
],
Expand Down Expand Up @@ -496,8 +499,7 @@
" 'ea33d4691b573336fc9c43c23fa90f65': 'Golden Gate Park Shuttle Schedule',\n",
" '5a075de618b4d2d2383550863fc8e44e': 'Santa Cruz Schedule',\n",
" '6b5c8acdaa4dcb280591578fcbf6c18e': 'SBMTD Schedule'\n",
"}\n",
"\n"
"}"
]
},
{
Expand Down Expand Up @@ -546,6 +548,7 @@
" <th>stop_name</th>\n",
" <th>n_arrivals</th>\n",
" <th>n_routes</th>\n",
" <th>route_id_list</th>\n",
" <th>stop_code</th>\n",
" <th>pt_geom</th>\n",
" <th>name</th>\n",
Expand All @@ -559,6 +562,7 @@
" <td>.</td>\n",
" <td>14</td>\n",
" <td>1</td>\n",
" <td>[16]</td>\n",
" <td>None</td>\n",
" <td>POINT(-119.294028 34.343645)</td>\n",
" <td>Gold Coast Schedule</td>\n",
Expand All @@ -570,6 +574,7 @@
" <td>10 Freeway and Azusa Ave E</td>\n",
" <td>110</td>\n",
" <td>2</td>\n",
" <td>[480, 707]</td>\n",
" <td>493</td>\n",
" <td>POINT(-117.908253 34.071995)</td>\n",
" <td>Foothill Schedule</td>\n",
Expand All @@ -581,6 +586,7 @@
" <td>10 Freeway and Azusa Ave W</td>\n",
" <td>113</td>\n",
" <td>2</td>\n",
" <td>[480, 707]</td>\n",
" <td>494</td>\n",
" <td>POINT(-117.906536 34.072337)</td>\n",
" <td>Foothill Schedule</td>\n",
Expand All @@ -592,6 +598,7 @@
" <td>10 Freeway and Puente Ave E</td>\n",
" <td>66</td>\n",
" <td>1</td>\n",
" <td>[707]</td>\n",
" <td>496</td>\n",
" <td>POINT(-117.960458 34.070065)</td>\n",
" <td>Foothill Schedule</td>\n",
Expand All @@ -603,6 +610,7 @@
" <td>10 Freeway and Puente Ave W</td>\n",
" <td>70</td>\n",
" <td>1</td>\n",
" <td>[707]</td>\n",
" <td>497</td>\n",
" <td>POINT(-117.959866 34.070698)</td>\n",
" <td>Foothill Schedule</td>\n",
Expand All @@ -619,12 +627,12 @@
"3 661ef844bdaa253e8b950740f76061b1 496 10 Freeway and Puente Ave E \n",
"4 661ef844bdaa253e8b950740f76061b1 497 10 Freeway and Puente Ave W \n",
"\n",
" n_arrivals n_routes stop_code pt_geom \\\n",
"0 14 1 None POINT(-119.294028 34.343645) \n",
"1 110 2 493 POINT(-117.908253 34.071995) \n",
"2 113 2 494 POINT(-117.906536 34.072337) \n",
"3 66 1 496 POINT(-117.960458 34.070065) \n",
"4 70 1 497 POINT(-117.959866 34.070698) \n",
" n_arrivals n_routes route_id_list stop_code pt_geom \\\n",
"0 14 1 [16] None POINT(-119.294028 34.343645) \n",
"1 110 2 [480, 707] 493 POINT(-117.908253 34.071995) \n",
"2 113 2 [480, 707] 494 POINT(-117.906536 34.072337) \n",
"3 66 1 [707] 496 POINT(-117.960458 34.070065) \n",
"4 70 1 [707] 497 POINT(-117.959866 34.070698) \n",
"\n",
" name \n",
"0 Gold Coast Schedule \n",
Expand Down
Loading
Loading