This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.


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

Returns numeric mixing matrix for attribute.

The attribute must be an integer.

  • 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=True)) – Return counts if False or probabilities if True.

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

Return type:

numpy array