Project 03 · Data analytics

Chicago Taxi Trip Analysis

✅ publisheddata: 2024-2025

Exploratory analysis of taxi trips in Chicago during 2024 and 2025. Using public city data, the study examines the busiest times and differences in duration, distance, fare and speed. Before creating the charts, the dataset is reviewed and cleaned to build consistent comparisons across days, time slots and companies.

Python
Pandas
Plotly
Taxi
Geospatial
Data analysis

CONTEXT AND OBJECTIVE

This project explores how taxi activity is distributed across Chicago and how it changes throughout the week. The analysis considers both the number of trips and the characteristics of each journey. Comparing travel times, distances and fares reveals differences between time slots and companies that trip volumes alone cannot explain.

The information comes from Chicago Taxi Trips, the city's public taxi trip database. The study uses data from 2024 and 2025, including dates, duration, distance, fares, tips, payment methods and companies. Pickup and drop-off information is also included where available. The source rounds timestamps and protects some location data; these limitations are considered when interpreting the results.

The comparison uses medians, percentiles and distributions. The median provides a reference for typical values, while percentiles show how much travel times and amounts can vary. Charts by time, day and company put those differences in context and reveal patterns of activity.

PREPARATION AND ANALYSIS CRITERIA

DATA QUALITY AND DERIVED VARIABLES

The original download is a CSV file that requires several checks before use. Dates arrive as text, some columns need conversion to numbers and certain fields are incomplete, particularly location fields. Pandas is used to standardize variable names, correct data types and measure missing values. Duplicate records and implausible combinations of duration, distance and amounts are also checked.

Preparation includes indicators that make trips easier to compare. Duration in minutes, estimated speed and fares per minute and per mile are calculated, together with tips as a proportion of the fare. When division produces an invalid value, the result is marked as missing to prevent distortion of the analysis.

Quality filters based on business criteria are then applied. Very short trips, near-zero distances, extreme speeds and fares outside reasonable ranges are set aside. Such cases can alter distributions and stretch chart scales. These checks help clarify the typical behavior of urban journeys.

  • Duration between 90 and 5,400 seconds and distance between 0.30 miles (483 m) and 50 miles (80.5 km).
  • Speed between 1 mph (1.6 km/h) and 70 mph (112.7 km/h), and base fare between 3.25 and 150 dollars.
  • Additional checks on tips, tolls, extra charges, total amount, and fares per mile and per minute.

Once the data is prepared, year, month, day of the week, hour and time-slot variables are created. The information available for each trip is also identified. For example, a record can support fare analysis even without map coordinates. This makes use of valid data for each indicator and avoids comparisons affected by incomplete fields.

ANALYSIS AND RESULTS

DEMAND BY DAY AND TIME

Demand is studied by month, day of the week and hour. The daily average helps compare how many trips typically occur in each time slot. The 25th and 75th percentiles show how activity changes between days and distinguish periods of steady activity from those with greater variation.

Around 15,800 daily trips are observed during the period analyzed. The charts show how this activity is distributed across times and days of the week, and compare companies. This identifies busier periods and distinguishes them from isolated increases on particular days.

DURATION, DISTANCE AND FARE STRUCTURE

Histograms identify the most common durations, distances and fares. Density plots relate these variables and show the combinations in which trips concentrate. This reveals how amounts change as journeys become longer, while retaining the diversity of situations within each interval.

Fares are also compared across trips of similar duration. The median and the 10th, 25th, 75th and 90th percentiles are calculated for each interval. This shows how much amounts can differ even for journeys taking similar times. Smoothed curves help trace the overall fare trend as duration increases.

Median duration is around 17 minutes and median distance is 4.4 miles (7.1 km). These values describe the center of the distributions. Comparing them with fares and their percentiles reveals differences between short, medium and long trips.

SPEED AND URBAN DYNAMICS

Estimated speed relates distance traveled to time taken. Median speeds are then compared by hour and day of the week. A heatmap identifies periods with higher or lower speeds and provides context for understanding why trips of similar distance can take different amounts of time.

Median speed during the period is around 15 mph (24.1 km/h). Its variation across time slots helps explain differences in duration and fare. Two trips of similar distance can take different amounts of time depending on the time of day.

DELIVERABLES AND LESSONS LEARNED

The results are presented through demand, duration, distance, fare and speed charts created with Matplotlib and Plotly. Comparisons by time and company move from an overview of activity to a closer view of journey characteristics. Density plots and heatmaps show relationships that a single indicator would overlook.

The analysis identifies busier times and compares how travel times and fares vary between trips. Medians and percentiles provide reference points for interpreting these differences. Initial cleaning is essential: it keeps comparisons focused on journeys with consistent information and prevents a few extreme values from determining the conclusions.