Taxi & ride-hail trips
NYC taxi and ride-hail trip records in Python: zones, fares, tips, speeds, airport trips, congestion pricing, and the fields that mislead.
New York's Taxi & Limousine Commission publishes every yellow-cab, green-cab and ride-hail trip as monthly Parquet files: pickup and drop-off time and taxi zone, distance, fare, surcharges and tip. A year of yellow cabs alone is 48.7 million rows, and the ride-hail file for a single month holds almost twenty million more. The records are a city-wide sensor for travel demand and traffic speed, and a receipt for every fare, which is what makes them worth learning to read carefully.
The guides here query the files with DuckDB, decode the fields, measure speeds and the busiest routes, compare congestion-zone speeds before and after January 2025, separate the airports, and set yellow cabs against Uber and Lyft. Three pages deal with the traps: cash trips that never record a tip, flex-fare rows with half their fields empty, and zone IDs that do not join to the map.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Analyse NYC Taxi Trip Records in Python with DuckDB
- How to Measure the Effect of Congestion Pricing with Taxi Trip Data
- How to Calculate Traffic Speeds by Hour from Taxi Trips
- How to Find the Busiest Taxi Routes Between NYC Zones
- How to Analyse Airport Taxi Trips: JFK Flat Fares and LaGuardia
- How to Compare Uber and Lyft with Yellow Taxis Using TLC High-Volume Data
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
Related topics
Subjects that keep coming up alongside this one, most overlap first.