momepy.clustering#
- momepy.clustering(graph, name='cluster')[source]#
Calculates the squares clustering coefficient for nodes.
Wrapper around
networkx.square_clustering
.- Parameters
- graphnetworkx.Graph
Graph representing street network. Ideally generated from GeoDataFrame using
momepy.gdf_to_nx()
- namestr, optional
calculated attribute name
- Returns
- Graph
networkx.Graph
Examples
>>> network_graph = mm.clustering(network_graph)