NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Student Works > Data Analysis on Pittsburgh Bus Ridership

Data Analysis on Pittsburgh Bus Ridership

Gopal (Sharath) Sharathchandra
Posted on Jun 12, 2021
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Data Analysis on Pittsburgh Bus RidershipView of downtown Pittsburgh

Objective

  • Analyze patterns of bus ridership in Pittsburgh, PA before and during Covid-19
  • Gain insights into and lay the foundation for forecasting ridership once the local economy opens more fully

We expect the data to show a drop in bus ridership during Covid-19. An understanding of how much, how quickly and in what manner ridership will recover has important implications for various entities and outcomes. They include:

  • Port Authority of Allegheny Countyโ€™s (the transit authority) operational decisions  such as the level of bus service to maintain or the reallocation of bus service across routes
  • Business activity, since a sustained drop in ridership due to increased work from home arrangements can portend reduced
    • office space demand with impact on commercial real estate values
    • business activity that is reliant on office goers such as lunchtime eateries or downtown shopping
  • County/state level planning for 
    • lower tax revenues due to decreased business activity in the above sectors
    • Other items such as potentially different traffic patterns arising from people switching to cars from buses leading to fewer buses but more cars on roads

Background

Pittsburgh has an active public transport system. Its geography comprises two rivers that join up to form a third river. That, combined with its hilly terrain creates limited points of entry into the city due to the presence of bridges and tunnels. Downtown parking is also severely limited, which makes public transport a more attractive option for commuting, particularly to downtown.

Pittsburgh has been proactive in developing public transport by converting a railroad track into a road dedicated only for buses that is called the Busway. It offers speedy connections between downtown and points east of the city. This further increases the attractiveness of public transport. Among other things, Pittsburgh is also a university town with several major universities. Students who attend those schools or the smaller universities around form a significant part of the ridership of buses. 

The Port Authority of Allegheny County is Pittsburghโ€™s main transit body; it operates buses, light rail and inclines. Figure 1 shows bus route P1 that goes along the Busway while Figure 2 shows bus route 61C that serves both Carnegie Mellon University and University of Pittsburgh on its way to downtown. Both buses travel from the east side of the city to downtown.

Fig. 1 Bus route P1 โ€“ travels to downtown along the Busway

Data Analysis on Pittsburgh Bus Ridership

Fig. 2 Bus route 61C โ€“ travels to downtown passes through CMU and Pitt 

Data Analysis on Pittsburgh Bus Ridership

Data

The dataset for the analysis was obtained from the Western Pennsylvania Regional Data Center at https://data.wprdc.org/dataset/port-authority-monthly-average-ridership-by-route .

It has the following attributes:

  • The values in the dataset are average ridership by route for each month
  • The average ridership is  broken out across weekday, Saturday and Sunday
  • The data covers ridership across buses, light rail (โ€˜Tโ€™) and inclines
  • The data is from Jan 2017 to Mar 2021
  • The dataset is a csv file with 11,884 rows  and 10 columns

For this study, I have focused on ridership data for buses and on weekdays. That covers the majority of the ridership and is also of the most relevance for the objectives of the project. 

As part of data cleansing, I excluded data on three bus routes (details are at the end of this article). 

The data used thus has average weekday ridership for 95 bus routes over a period of 51 months (Jan 2017 to Mar 2021). The code and data can be found at https://github.com/gopalsharath/pitt-bus-ridership.git

Summary of Data findings โ€“ before Covid

  • The average weekday ridership across all bus routes in Pittsburgh was 179,000 in 2017 and 185,000 in both 2018 and 2019.  The average weekday ridership showed a 3% increase from 2017 to 2018 but was flat from 2018 to 2019.
  • The top 10 bus routes in terms of ridership account for about 33% of total ridership (see Figure 3). All of these serve downtown and 7 of the 10 routes pass through both major universities โ€“ Carnegie Mellon University (CMU) and University of Pittsburgh (Pitt). 

Fig. 3 Top 10 bus routes โ€“ average weekday ridership in 2019

  • The aggregate bus ridership shows seasonality. This can be seen clearly in Fig 4, which shows the aggregate weekday ridership across all routes. There is a sharp peak in Sept with a correspondingly sharp trough in Dec. Next, there is a smaller peak during Feb - Apr with a smaller trough in June - July.
  • As noted earlier, Pittsburgh is a university town, so it made sense to explore if the seasonality is driven by student ridership. Fig 5 shows the ridership graphs of four different bus routes โ€“ P1, 51, 61C and 71C. Of these, the first two โ€“ P1 and 51 โ€“ go to downtown directly without touching the two main universities (CMU and Pitt), while the other two โ€“ 61C and 71C โ€“ pass through these two universities and do carry student riders. Fig 5 indicates that:
  • Seasonality appears stronger in bus routes 61C and 71C which is not surprising given that many students tend to leave town during semester breaks
  • At the same time, there is still noticeable seasonality in the bus routes P1 and 51 which suggests that seasonality is not just due to students but is more broadly based and likely due to vacation patterns of the workforce. It seems that people are most present in the office during  Sept - Oct and most away from the office during Nov - Dec with a secondary peak in Feb-Apr and a secondary valley in June-July.

Fig. 4 Weekday aggregate ridership

     Fig 5 Weekday ridership on bus routes P1, 51, 61C and 71C 

Summary of Data findings โ€“ during Covid

Ridership

  • There is a steep decline in aggregate ridership during the Covid period of Apr 2020 โ€“ Mar 2021. The average weekday aggregate ridership fell by (see Fig 4) 73% in April 2020, 70% in Dec 2020 and 65% in Mar 2021 relative to the average weekday ridership level during all of 2019. I used the entire year of 2019 as the baseline to control for seasonality. Also, I did not calculate the decline relative to Mar 2020 as some of the impacts of Covid were already reflected during that month.
  • Fig 6 shows a comparison of the distribution of the average weekday ridership across the 95 bus routes during 2019 and during the Covid period. The 2019 boxplot shows the outsize contribution of the top 10 bus routes to ridership that was noted earlier in Fig 3. A comparison of the two boxplots shows that the median of the average weekday ridership among the bus routes has declined by around 60% during the Covid period as compared to 2019. 

Economic Effect

  • The seasonality that was observed during 2017 โ€“ 2019 is partly intact during 2020 (Figs 4 and 5). It was disrupted during Apr โ€“ June 2020, presumably due to the abrupt shock of the economic shutdown due to Covid. However, during July 2020 โ€“ Sept 2020 and Sept 2020 โ€“ Dec 2020, the historically observed seasonality can still be seen. The upward trend in ridership seen during Dec 2020 โ€“ Mar 2021 is also consistent with the observed seasonality, so the rising trend seen in Mar 2021 may not yet reflect greater opening of the economy.
  • Figure 7 provides another perspective of the drop in ridership during the Covid period by showing the distribution across all bus routes of the percentage drop in ridership during the Covid period relative to the average level in 2019. The distributions are shown in the form of boxplots at three different months during the Covid period โ€“ April 2020, Dec 2020 and Mar 2021. The boxplots tell a similar story to what is seen at the aggregate level in Fig 4. 
    • The median percentage drop in April 2020 is around 70%
    • By Dec 2020, the median percentage drop is slightly higher but the spread of the distribution is slightly tighter
    • As of Mar 2021, the distribution has shifted up by about 5%. As this could be due to seasonality, it is too early to tell if there has been a pickup in ridership reflecting the improving pandemic and economic outlook

Fig 6 Bus ridership distribution  -   2019 vs Covid period

      Fig 7 Bus ridership reduction distribution  in Covid period 

Conclusions

The analysis has found the following with respect to average weekday bus ridership in Pittsburgh during Jan 2017 โ€“ Mar 2021

  • Ridership is disproportionate across bus routes with the top 10 out of 95 routes contributing 33% of total ridership in 2019
  • Significant seasonality pattern in ridership is seen across bus routes during 2017 โ€“ 2019 including those not frequently used by students
  • Ridership drops by around 70% on average across all bus routes at the start of Covid and doesn't pick up through the end of 2020
  • Except for an initial disruption, seasonality was observed even among the depressed levels of ridership in the Covid period, so that the recent pickup in ridership could still be due to seasonality and not due to any secular economic effects

Given the anticipated pace of reopening of workplaces and of universities, it would be opportune to repeat the analysis in the upcoming months using refreshed data to better identify ridership trends.

Reflection

If the analysis is used to develop forecasts of ridership, it is important that the forecasting methodology is able to separate seasonality from the trend, given the significant role of seasonality in weekday bus ridership. The analysis can also be expanded to include light rail data, which would add more data points particularly for ridership from the south of Pittsburgh. Finally, it may be worth looking more closely at weekend ridership data to identify any trends and insights that could be brought to bear on the current analysis.

This analysis and its further extensions can help with predicting and understanding how working arrangements evolve post covid, to what extent part of the workforce may end up permanently working from home - full time or part time โ€“ and the implications of this for the broader economy.

Data cleansing details

Data on the following bus routes was excluded

  • โ€˜MNT1โ€™
    • It was unclear if this was even a bus route or was just a data error
    • Further the data were very sparse and sporadic across the time period
  • Route 68 โ€“ data was available for only 30 for the 51 weeks
  • Route 78 โ€“ data was available for only 8 out of the 51 weeks

About Author

Gopal (Sharath) Sharathchandra

Executive with 25+ years experience in financial services and career-long passion for applying analytics and data to addressing business questions. Excited about data science and machine learning. Enjoys reading.
View all posts by Gopal (Sharath) Sharathchandra >

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application