Uber and Lyft Cab Prices Data Analysis and Visualization

Mrinalini Sunder
Mindtrades Consulting
5 min readJul 27, 2021

Both Uber and Lyft are ride-hailing services that allow users to hire vehicles with drivers through websites or mobile apps. Uber is a global company available in 69 countries and around 900 cities worldwide. Lyft, on the other hand, operates in about 644 cities in the US and 12 cities in Canada only. Yet, in the US, it’s the second-largest ridesharing company with a 31% market share.

From booking the cab to paying the bill, both services have almost similar core features. But there are some unique cases where the two ride-hailing services come neck to neck. One such is pricing, especially dynamic pricing called “surge” in Uber and “Prime Time” in Lyft.

We have an interesting dataset with data from Boston (US), which we will analyze to understand the factors affecting the dynamic pricing and the difference between Uber and Lyft’s special prices.

Dataset

The datasets used in this article have been imported from:

The data has been collected from different sources, including real-time data collection using Uber and Lyft API (Application Programming Interface) queries. The dataset covers Boston’s selected locations and covers approximately a week’s data from November 2018.

After loading the dataset, we found two files available. The first is the weather.csv, and the second is cab_rides.csv.

Data Analysis

The data has been analyzed using Python and visualized with Power BI. For a similar analysis where the data is updated regularly, we recommend using www.datom.ai, a code-free tool with usage-based pricing that allows for scheduling importing of data, data cleansing, data syndication, and other features. Datom.ai also assists with importing other sources of data and combining it with the named datasets above so that the final analysis can be even more insightful.

To perform the analysis, we split our dataset into two sets for comparison: Uber and Lyft.

Factors Affecting Cab Prices

Distance and Price Correlation

Uber Distance Vs. Price Correlation

Lyft Distance Vs. Price Correlation

*In the graph above, the color yellow signifies a strong positive correlation, and the color purple indicates a low correlation

Interpretation:

  • For Lyft: surge multiplier and distance are weakly correlated.
  • For Lyft: surge multiplier and price are more correlated.
  • For Uber: price and distance are weakly correlated.

Surge Correlation with Days (only for Lyft)

*We do not have surge values for Uber

Interpretation:

  • A surge of 1.25x the regular price is most common.
  • On the weekdays, Tuesday is most likely to experience a surge during rush hours, while Wednesday experiences the least.
  • A surge in the price of 3.0x happens rarely.

Surge Correlation with the Time of Day (only for Lyft)

Interpretation:

  • Lyft’s Prime Timing happens the most during nighttime.
  • Morning rush hours also contribute to the surge.
  • A surge is less likely to happen during the afternoon and evening.

Surge Correlation with Source and Destination

Interpretation:

  • The routes from Back Bay to Boston University experience a higher surge in cab prices.
  • Haymarket Square to Beacon Hill experiences the least surge in prices.

Uber vs. Lyft

  • Distance vs. Price

Interpretation:

  • Uber is riders’ first choice irrespective of distance.

Number of Shared Rides with Time of Day

Number of Shared Rides with Distance and Price

Interpretation:

  • People most likely have shared rides during the nighttime.
  • As the distance increases, the price also increases.
  • The number of shared rides is not growing with the increase in distance.
  • Apparently, people prefer to have shared rides for smaller distances. People like taking shared rides over the courses of short passages, roughly lying between 1 to 3 kilometers.

Rides correlation with Weather

Who gets more ride when it rains

Interpretation:

  • The number of rides increases with an increase in temperature.
  • People tend to avoid rides when it rains.
  • Lyft gets slightly more rides than Uber, but this cannot be generalized as we have very little data (only 3,866).

Summary

If you were a Business Analyst working for either Uber or Lyft, you could draw the following conclusions:

  1. Uber is more economical; however, Lyft also provides fair competition.
  2. People prefer to have shared rides during the nighttime.
  3. People avoid taking rides when it rains.
  4. When traveling long distances, the price does not increase linearly. However, based on the time and demand, a surge can affect the cost.
  5. Uber can be the first choice for long distances.

How can MindTrades help?

MindTrades Consulting Services, a leading marketing agency provides in-depth analysis and insights for the global IT sector including leading data integration brands such as Diyotta. From Cloud Migration, Big Data, Digital Transformation, Agile Deliver, Cyber Security, to Analytics- Mind trades provides published breakthrough ideas and prompt content delivery. For more information, check mindtrades.com.

Code

All the codes used here are available at GitHub and can be found here — https://github.com/Mindtrades-Consulting/Uber-and-Lyft-Cab-Prices-Data-Analysis-and-Visualization

--

--