segregation.network.compute_travel_cost_matrix¶
- segregation.network.compute_travel_cost_matrix(origins, destinations, network, reindex_name=None)[source]¶
Compute a shortest path matrix from a pandana network
- Parameters:
- origins
geopandas.GeoDataFrame
the set of origin geometries. If polygon input, the function will use their centroids
- destinations
geopandas.GeoDataFrame
the set of destination geometries. If polygon input, the function will use their centroids
- network
pandana.Network
Initialized pandana Network object holding a travel network for a study region
- reindex_name
str
,optional
Name of column on the origin/destinatation dataframe that holds unique index values If none (default), the index of the pandana Network node will be used
- origins
- Returns:
pandas.DataFrame
an origin-destination cost matrix. Rows are origin indices, columns are destination indices, and values are shortest network path cost between the two