- momepy.gamma(graph, radius=5, name='gamma', distance=None, verbose=True)#
Calculates connectivity gamma index for subgraph around each node if radius is set, or for whole graph, if
Subgraph is generated around each node within set radius. If
distance=None, radius will define topological distance, otherwise it uses values in
where \(e\) is the number of edges in subgraph and \(v\) is the number of nodes in subgraph.
Adapted from [Dibble et al., 2017].
Graph representing street network. Ideally generated from GeoDataFrame using
- radius: int
Include all neighbors of distance <= radius from n
- namestr, optional
calculated attribute name
- distancestr, optional
Use specified edge data key as distance. For example, setting
distance=’weight’will use the edge
weightto measure the distance from the node n.
- verbosebool (default True)
if True, shows progress bars in loops and indication of steps
networkx.Graph if radius is set
gamma index for graph if
>>> network_graph = mm.gamma(network_graph, radius=3)