iduedu.transport_stats¶
- iduedu.transport_stats(urban_graph, *, modes=None)[source]¶
Stops, routes and stop spacing of every public-transport mode of a graph.
Works on public-transport and intermodal graphs, where the edges between stops and the stop nodes of a mode carry the mode as their
type(bus,tram,subway, …).- Parameters:
urban_graph (
UrbanGraph) – Graph with atypecolumn on nodes and edges.modes (
Optional[Iterable[str]]) – Modes to report. By default the edge types that are modes of the transport registry (DEFAULT_REGISTRY_W_TRAIN) or GTFS route types; pass the names of custom modes here.
- Return type:
- Returns:
DataFrame indexed by mode with columns
stop_count(stop nodes of the mode),route_count(distinct values of the edge columnroute,NaNwithout it),edge_count,length_km(sum oflength_meter, both directions of a route counted),stop_spacing_mean(mean edge length, metres) andspeed_kmh(total length over total travel time).- Raises:
KeyError – If nodes or edges have no
typecolumn.