momepy.
mean_node_degree
(graph, radius=5, name='mean_nd', degree='degree', distance=None)[source]¶Calculates mean node degree for subgraph around each node.
Subgraph is generated around each node within set radius. If distance=None, radius will define topological distance, otherwise it uses values in distance attribute.
Graph representing street network.
Ideally genereated from GeoDataFrame using momepy.gdf_to_nx()
radius defining the extent of subgraph
calculated attribute name
name of attribute of node degree (momepy.node_degree()
)
Use specified edge data key as distance. For example, setting distance=’weight’ will use the edge weight to measure the distance from the node n.
networkx.Graph
Examples
>>> network_graph = mm.mean_node_degree(network_graph, radius=3)