attribute_mixing_dict(G, attribute, nodes=None, normalized=False)
NetworkX graph object.
Node attribute key.
Unse nodes in container to build the dict. The default is all nodes.
Return counts if False or probabilities if True.
Counts or joint probability of occurrence of attribute pairs.
Returns dictionary representation of mixing matrix for attribute.
>>> G = nx.Graph()
... G.add_nodes_from([0, 1], color="red")
... G.add_nodes_from([2, 3], color="blue")
... G.add_edge(1, 3)
... d = nx.attribute_mixing_dict(G, "color")
... print(d["red"]["blue"]) 1
>>> print(d["blue"]["red"]) # d symmetric for undirected graphs 1See :
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.assortativity.mixing.attribute_mixing_dict
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