networkx.numeric_mixing_matrix

networkx.numeric_mixing_matrix(G, attribute, nodes=None, normalized=True)[source]

Return numeric mixing matrix for attribute.

The attribute must be an integer.

Parameters:

G : graph

NetworkX graph object.

attribute : string

Node attribute key. The corresponding attribute must be an integer.

nodes: list or iterable (optional)

Build the matrix only with nodes in container. The default is all nodes.

normalized : bool (default=False)

Return counts if False or probabilities if True.

Returns:

m: numpy array

Counts, or joint, probability of occurrence of node attribute pairs.