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