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