Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.algorithms.assortativity.numeric_mixing_matrix

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

Returns numeric mixing matrix for attribute.

The attribute must be an integer.

Parameters
Ggraph

NetworkX graph object.

attributestring

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.

normalizedbool (default=True)

Return counts if False or probabilities if True.

Returns
m: numpy array

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