momepy.mean_node_dist

momepy.mean_node_dist(graph, name='meanlen', length='mm_len')[source]

Calculates mean distance to neighbouring nodes.

Mean of values in length attribute.

Parameters
graphnetworkx.Graph

Graph representing street network. Ideally genereated from GeoDataFrame using momepy.gdf_to_nx()

namestr, optional

calculated attribute name

lengthstr, optional

name of attribute of segment length (geographical)

Returns
Graph

networkx.Graph

Examples

>>> network_graph = mm.mean_node_dist(network_graph)