vehicle_idle_time¶
vehicle_idle_time
¶
vehicle_idle_time(vehicle_panel: DataFrame, *, threshold_hours: float = 48.0, move_threshold_m: float = 50.0) -> DataFrame
Fraction of the fleet that has not moved for threshold_hours, as a time series.
Operators advertise large fleets, but researchers suspect a sizeable share is abandoned,
broken (without an is_disabled flag) or stuck in courtyards. For each snapshot this reports
the share of vehicles whose position has not changed (beyond move_threshold_m) for at least
threshold_hours, quantifying the "zombie fleet".
Requires stable vehicle_id over the window. GBFS 2.1+ rotates ids for privacy; idle
detection is only meaningful where the feed keeps them stable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vehicle_panel
|
DataFrame
|
Long frame of vehicle snapshots with |
required |
threshold_hours
|
float
|
Idle duration above which a vehicle counts as idle. |
48.0
|
move_threshold_m
|
float
|
Displacement (great-circle metres) above which a vehicle is considered to have moved. |
50.0
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
See Also
detect_ghost_vehicles : Flag individually immobile units.
reconcile_fleet_state : The deduplicated fleet tally.
Examples:
>>> import pandas as pd
>>> panel = pd.DataFrame({
... "system_id": "s", "vehicle_id": "v1",
... "lat": [48.85, 48.85], "lon": [2.35, 2.35],
... "fetched_at": pd.to_datetime(["2026-01-01T00:00Z", "2026-01-05T00:00Z"]),
... })
>>> float(vehicle_idle_time(panel)["idle_fraction"].iloc[-1])
1.0