node_degree#
- node_degree(domain, network_name, edge_weight_name=None, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0)#
Computes the degree for each node. If no edge weight name is given, unweighted node degree is computed.
- Parameters:
- domainobject
The domain containing the networks.
- network_namestr
The name of the network within the domain.
- edge_weight_namestr, optional
The name of the edge weight attribute, by default None.
- populationarray-like or query, optional
A query or array of object indices to filter the labels. Default is None.
- include_boundariesarray-like, query-like, or None, optional
Boundaries to include in the analysis. Defaults to None.
- exclude_boundariesarray-like, query-like, or None, optional
Boundaries to exclude from the analysis. Defaults to None.
- boundary_exclude_distancefloat, optional
Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.
- Returns:
- degreesnumpy.ndarray
An array of the degrees in order of node appearance.
- node_object_indicesnumpy.ndarray
An array of node indices.
- Raises:
- RuntimeError
If the network name is not found in the domain.
- RuntimeError
If the specified edge weight name does not exist in the network.