momepy.mean_node_dist#
- momepy.mean_node_dist(graph, name='meanlen', length='mm_len', verbose=True)[source]#
Calculates mean distance to neighbouring nodes. Mean of values in
length
attribute.- Parameters:
- graphnetworkx.Graph
A Graph representing a street network. Ideally generated from GeoDataFrame using
momepy.gdf_to_nx()
.- namestr, optional
The calculated attribute name.
- lengthstr, optional
The name of the attribute of segment length (geographical).
- verbosebool (default True)
If
True
, shows progress bars in loops and indication of steps.
- Returns:
- netxGraph
A networkx.Graph object.
Examples
>>> network_graph = mm.mean_node_dist(network_graph)