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:
originsgeopandas.GeoDataFrame

the set of origin geometries. If polygon input, the function will use their centroids

destinationsgeopandas.GeoDataFrame

the set of destination geometries. If polygon input, the function will use their centroids

networkpandana.Network

Initialized pandana Network object holding a travel network for a study region

reindex_namestr, 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

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