Comparison of Uber and Lyft Cab Services in Boston, MA

Posted on Mar 21, 2023


Uber and Lyft both adopted a business model known as a customer-to-customer (C2C) model by utilizing technology. It is a great alternative to traditional taxi services that offer door-to-door convenience, safety, and reliable quality. Both companies are based in San Francisco but could vary in terms of price, time, culture, and offering different options. This blog will analyze and visualize data comparing Uber and Lyft ridesharing services in Boston, MA to identify similarities and differences.

About Dataset

I collected the dataset from for this project. It consists of 693,071 observations and 57 variables covering the period from November 26 to December 18 of 2018 for the Boston Area. This dataset contains some missing values and requires cleaning. You can find it by clicking this link.

Libraries Used

I used the following Python libraries for this project:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import as px
import scipy.stats as stats
import datetime
import calendar

These are the standard libraries that are often used in exploratory data analysis and visualization.

Uber and Lyft Ridesharing Services Comparison

Price Comparison

Let's dive into exploratory data analysis. According to the bar chart below, residents of Boston prefer Uber cab services over Lyft.

The popularity of Uber over Lyft could be explained by prices. As demonstrated below, Uber rides on average tend to be cheaper compared to Lyft with a mean price of $16.00 for Uber rides and $17.00 for Lyft.

I thought that it would be a great idea to perform a t-test to compare the means of these two cabs, with the null hypothesis that there is no difference in price means and an alternative hypothesis that there is a difference in price means for Uber and Lyft cab services. I used scipy.stats library to calculate the t-test and got the following results:

Ttest_indResult(statistic=-66.83531585586235, pvalue=0.0)

The low p-value which is equals to 0.00 just confirms what we observed earlier.

Now let's compare the prices of Uber and Lyft by different ride options:

According to the bar chart above,  Lyft's Shared option is cheaper compared to Uber's UberPool, however, Uber's WAV option is priced about the same as Lyft's Lyft. For the other four options, Uber offers more competitive prices compared to Lyft.

Hours Dynamic

When it comes to hours dynamic, both Uber and Lyft have the same pattern: rides tend to peak at 11 pm and 12 am. with a drastic decrease from around 1 am to 5 am. We can observe another increase in user rides from 8 am to 6 pm and then another rapid decline from 7 pm to 10 pm.

Rides per day of the week

According to the graph below, Monday and Tuesday are the busiest, while Wednesday is the lightest weekday for both Uber and Lyft. Rides tend to be evenly distributed from Friday to Sunday.


To summarize the finding above, Uber and Lyft cab services might vary in price but have the same patterns when it comes to frequency of usage for time and day of the week. For the future development of this project, I would like to explore more features to determine differences and similarities.


About Author

Liliya Lopez

Dedicated professional with comprehensive skills in quantitative science, analysis, research, predictive models, and working with cross-functional teams to achieve goals. Known as an innovative thinker with statistics, data analytics, R and Python development, visualization, machine learning models, and...
View all posts by Liliya Lopez >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

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 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 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 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