Comparison of Uber and Lyft Cab Services in Boston, MA
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.
I collected the dataset from Kaggle.com 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.
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 plotly.express 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
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:
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.
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.