Transport · Public data

NYC yellow taxi trips

Every New York City yellow cab trip of the latest published month, with TLC taxi zones.

New York City Taxi and Limousine Commission (TLC) Trip Record Data · Public domain / NYC Open Data Terms of Use · commons_pubdata.transport.nyc_taxi_trips

Read Markdown

Registered, not loaded yet: the table is not in the catalog. This page fills in after its first refresh.

Query it with DuckDB.

Bash
lhbox duckdb --catalog commons/pubdata
SQL · Top 15 pickup-to-dropoff routes by trip volume
SELECT pz.borough AS from_borough, pz.zone AS from_zone,
       dz.borough AS to_borough, dz.zone AS to_zone,
       count(*) AS trips,
       round(avg(t.trip_distance_mi), 2) AS avg_miles,
       round(avg(t.total_amount), 2) AS avg_total_usd
FROM commons_pubdata.transport.nyc_taxi_trips AS t
JOIN commons_pubdata.transport.nyc_taxi_zones AS pz ON pz.location_id = t.pickup_location_id
JOIN commons_pubdata.transport.nyc_taxi_zones AS dz ON dz.location_id = t.dropoff_location_id
GROUP BY 1, 2, 3, 4 ORDER BY trips DESC LIMIT 15;

Read it where you work.

Public, read-only data. With an account, lhbox duckdb attaches the catalog as commons_pubdata; an agent with the LakehouseBox connector opens it with open_public_catalog("commons/pubdata"). Without one, DuckDB reads the public files directly.

More example queries

  • Daily NYC taxi trips and average credit-card tip % by day of week
    SQL
    SELECT date, dayname(date) AS weekday, count(*) AS trips,
           round(avg(tip_amount / NULLIF(fare_amount, 0)) FILTER (WHERE payment_type = 1 AND fare_amount > 0) * 100, 1) AS card_tip_pct
    FROM commons_pubdata.transport.nyc_taxi_trips
    GROUP BY 1, 2 ORDER BY date;

Know your columns.

ColumnTypeMeaning
pickup_timetimestampmeter engagement timestamp (local NYC time)
dropoff_timetimestampmeter disengagement timestamp (local NYC time)
datedatepickup calendar date (joins calendars.public_holidays, weather.forecast and reference.fx_rates)
vendor_idintTPEP provider code (1 = Creative Mobile Technologies, 2 = Curb Mobility, 6 = Myle, 7 = Helix)
passenger_countintdriver-entered or meter passenger count
trip_distance_midoubleelapsed trip distance in miles reported by the taximeter
View all 17 columns
rate_code_idintfinal rate code (1 = Standard, 2 = JFK, 3 = Newark, 4 = Nassau/Westchester, 5 = Negotiated, 6 = Group)
pickup_location_idintTLC taxi zone where the meter was engaged (joins transport.nyc_taxi_zones)
dropoff_location_idintTLC taxi zone where the meter was disengaged (joins transport.nyc_taxi_zones)
payment_typeint1 = Credit card, 2 = Cash, 3 = No charge, 4 = Dispute, 5 = Unknown
fare_amountdoubletime-and-distance fare calculated by the meter, USD
tip_amountdoubletip amount, USD (automatically populated for credit card tips; cash tips are not recorded)
tolls_amountdoubletotal amount of all tolls paid in trip, USD
congestion_surchargedoubleNew York State congestion surcharge collected in trip, USD
airport_feedoublepickup fee at LaGuardia and John F. Kennedy airports, USD
total_amountdoubletotal amount charged to passengers (does not include cash tips), USD
year_monthstringpublished TLC file month, YYYY-MM

Join keys: date, pickup_location_id, dropoff_location_id.

Companion tables

  • commons_pubdata.transport.nyc_taxi_zones: the 265 NYC TLC taxi zones: location_id, borough, zone name and service_zone (Yellow Zone, Boro Zone, Airports)

Before you query.

  1. Outlier timestamps outside the published calendar month (clock errors in the raw TLC file) are filtered out on load so date always lies within year_month.
  2. tip_amount is recorded only for credit card rides (payment_type = 1); filter on payment_type = 1 when computing tip percentages.
  3. Join pickup_location_id or dropoff_location_id to transport.nyc_taxi_zones.location_id for borough and neighborhood names.

Source & licence.

Source
New York City Taxi and Limousine Commission (TLC) Trip Record Data
Licence
Public domain / NYC Open Data Terms of Use
Attribution
Source: NYC Taxi and Limousine Commission (TLC) Trip Record Data, City of New York.
Coverage
New York City (265 TLC taxi zones across the five boroughs and EWR); latest published calendar month (~3.3 million trips), replaced monthly
Refresh
monthly, the whole table replaced; source version n/a
Table
commons/pubdata · transport.nyc_taxi_trips · Iceberg v? · browse the catalog
Recipe
pubdata/recipes/nyc_taxi.py, registry entry pubdata/registry/nyc_taxi.yaml

Source: New York City Taxi and Limousine Commission (TLC) Trip Record Data · Public domain / NYC Open Data Terms of Use · Snapshot shown: not loadedHTML for people. Markdown for agents.