NetworkX

Previous topic

networkx.algorithms.mixing.degree_pearsonr

Next topic

networkx.algorithms.mixing.degree_mixing_matrix

networkx.algorithms.mixing.attribute_mixing_matrix

networkx.algorithms.mixing.attribute_mixing_matrix(G, attribute, mapping=None, normalized=True)

Return mixing matrix for attribute.

Parameters :

G : graph

NetworkX graph object.

attribute : string

Node attribute key.

mapping : dictionary, optional

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

normalized : bool (default=False)

Return counts if False or probabilities if True.

Returns :

m: numpy array :

Counts or joint probability of occurrence of attribute pairs.