Definitions & basic recap

Intermediate Network Analysis in Python

Eric Ma

Data Carpentry instructor and author of nxviz package

Network/Graph

  • Network = Graph = (nodes, edges)
  • Directed or Undirected
    • Facebook: Undirected
    • Twitter: Directed
  • networkx: API for analysis of graphs

ch1-1.004.png

Intermediate Network Analysis in Python

Basic NetworkX API

import networkx as nx

G
<networkx.classes.graph.Graph at 0x10b192da0>
list(G.nodes())
['customer1', 'customer3', 'customer2']
Intermediate Network Analysis in Python

Basic NetworkX API

len(G.nodes())
3
len(G.edges())
2
type(G)
networkx.classes.graph.Graph
Intermediate Network Analysis in Python

Network visualization

  • nxviz: API for creating beautiful and rational graph viz

  • Prioritize placement of nodes

ch1-1.019.png

Intermediate Network Analysis in Python

Network visualization

  • nxviz: API for creating beautiful and rational graph viz

  • Prioritize placement of nodes

ch1-1.020.png

Intermediate Network Analysis in Python

Network visualization

  • nxviz: API for creating beautiful and rational graph viz

  • Prioritize placement of nodes

ch1-1.021.png

Intermediate Network Analysis in Python

Network visualization

  • nxviz: API for creating beautiful and rational graph viz

  • Prioritize placement of nodes

ch1-1.022.png

Intermediate Network Analysis in Python

Basic nxviz API

import nxviz as nv
import matplotlib.pyplot as plt

c = nv.circos(G)
plt.show()

ch1-1.028.png

Intermediate Network Analysis in Python

Let's practice!

Intermediate Network Analysis in Python

Preparing Video For Download...