networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
numeric_mixing_matrix(G, attribute, nodes=None, normalized=True, mapping=None)
deprecated

numeric_mixing_matrix is deprecated and will be removed in 3.0. Use :None:None:`attribute_mixing_matrix` instead.

Notes

If each node has a unique attribute value, the unnormalized mixing matrix will be equal to the adjacency matrix. To get a denser mixing matrix, the rounding can be performed to form groups of nodes with equal values. For example, the exact height of persons in cm (180.79155222, 163.9080892, 163.30095355, 167.99016217, 168.21590163, ...) can be rounded to (180, 163, 163, 168, 168, ...).

Parameters

G : graph

NetworkX graph object.

attribute : string

Node attribute key.

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.

mapping : dictionary, optional

Mapping from node attribute to integer index in matrix. If not specified, an arbitrary ordering will be used.

Returns

m: numpy array

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

Returns numeric mixing matrix for attribute.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/assortativity/mixing.py#212
type: <class 'function'>
Commit: