O'Reilly logo

Complex Network Analysis in Python by Dmitry Zinoviev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Analyze the Network

Out of so many ways to analyze a network, let’s focus on degree and assortativity analysis. All network nodes have two attributes: kind (with three possible values Entities, Officers, or Intermediaries) and country. Let’s have a look at each of the assortativities, both directly and through the attribute mixing matrix (only for the kind).

 nx.attribute_assortativity_coefficient(panama0, ​"kind"​)
 nx.attribute_mixing_matrix(panama0, ​"kind"​,
  mapping={​"Entities"​: 0, ​"Officers"​: 1,
 "Intermediaries"​ : 2})
 nx.attribute_assortativity_coefficient(panama0, ​"country"​)
 nx.degree_assortativity_coefficient(panama0)
<= -0.9896603076687625
 array([[ 0.00000000e+00, 4.97403946e-01, 2.59605400e-04],
  [ 4.97403946e-01, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required