momepy.node_degree#

momepy.node_degree(graph, name='degree')[source]#

Calculates node degree for each node. Wrapper around networkx.degree().

Parameters
graphnetworkx.Graph

A Graph representing a street network. Ideally generated from GeoDataFrame using momepy.gdf_to_nx().

namestr (default ‘degree’)

The calculated attribute name.

Returns
netxGraph

A networkx.Graph object .

Examples

>>> network_graph = mm.node_degree(network_graph)