ac-transit-apc / README.md
somemone's picture
Note the Hive partition columns
19308a9 verified
|
Raw
History Blame Contribute Delete
4.38 kB
metadata
license: cc-by-4.0
language:
  - en
pretty_name: AC Transit Automatic Passenger Counter Records, 2019-2026
size_categories:
  - 100M<n<1B
task_categories:
  - time-series-forecasting
tags:
  - transit
  - transportation
  - mobility
  - urban
  - geospatial
  - bay-area
configs:
  - config_name: default
    data_files: year=*/month=*/data_0.parquet

AC Transit Automatic Passenger Counter Records, 2019-2026

Stop-level boarding and alighting counts for the AC Transit bus network in Alameda and Contra Costa counties, California, from January 2019 through May 2026. The records come from the automatic passenger counters (APCs) mounted at the doors of the buses: one row per stop event, with the number of passengers who got on, the number who got off, and the load the bus left with.

89 monthly Parquet files, ~5.9 GB, partitioned year=/month=. The span covers the pre-pandemic baseline, the March 2020 collapse, and the uneven recovery that followed, which is the comparison the data was assembled to support.

Loading

import pandas as pd

df = pd.read_parquet(
    "hf://datasets/somemone/ac-transit-apc/year=2019/month=2/data_0.parquet"
)

Or the whole thing as a partitioned dataset:

import pyarrow.dataset as ds
from huggingface_hub import snapshot_download

path = snapshot_download("somemone/ac-transit-apc", repo_type="dataset")
table = ds.dataset(path, format="parquet", partitioning="hive")

Schema

column type notes
route string route as reported by the vehicle
route_id string GTFS route identifier
stop_id string GTFS stop identifier
event_timestamp timestamp[us] when the doors opened
service_date timestamp[us] service day the event belongs to
boardings int32 passengers on
alightings int32 passengers off
passenger_load int32 load leaving the stop
latitude double stop position
longitude double stop position
door_lift_flags_possibly string vehicle flag field; its low bit separates the two APC-equipped subfleets

Readers that understand Hive partitioning also surface year and month as columns, recovered from the directory names rather than stored in the files.

Working with it

These are raw counts, not ridership estimates. Two corrections matter before the numbers mean what you want them to:

  • Partial fleet coverage. Not every bus carries a working APC, and the equipped share varies by route and by month. Summing raw boardings undercounts actual ridership, unevenly. Scale by the observed capture rate per (route, subfleet) before comparing across routes or over time. The low bit of door_lift_flags_possibly separates the two subfleets, which have materially different capture rates.
  • Drift against reported totals. Even after capture correction, monthly sums do not match the agency's National Transit Database filings. A per-month calibration factor closes the gap.

passenger_load is the counter's running estimate and accumulates error along a trip; it is more useful for relative load profiles than as an absolute.

A small number of coordinates are wrong. In a representative month, ~0.1% of rows across ~15 stop IDs fall outside the service area, and the extremes land hundreds of kilometres away. Most apparent outliers are legitimate -- the network reaches Fremont, and the Dumbarton corridor crosses to Palo Alto -- but do not derive a bounding box from min/max without filtering first.

Privacy

The records contain no operator, vehicle, or fare-media identifiers, and no rider-level information of any kind. A row is a count at a stop at a time. Coordinates are bus stop positions.

Provenance and license

The underlying records originate with the Alameda-Contra Costa Transit District (AC Transit). Released here under CC BY 4.0. This dataset is not affiliated with or endorsed by AC Transit.

Related

Built for the AC Transit Ridership Explorer, an interactive map of weekly stop-level ridership and pandemic recovery (live). That repository carries the capture-correction and calibration pipeline these records feed.