定義與重點回顧

Python 網路分析進階

Eric Ma

Data Carpentry instructor and author of nxviz package

Network/Graph

  • Network = Graph = (節點、邊)
  • 有向或無向
    • Facebook:無向
    • Twitter:有向
  • networkx:用於圖形分析的 API

第 1 章圖 1.004

Python 網路分析進階

NetworkX 基本 API

import networkx as nx

G
<networkx.classes.graph.Graph at 0x10b192da0>
list(G.nodes())
['customer1', 'customer3', 'customer2']
Python 網路分析進階

NetworkX 基本 API

len(G.nodes())
3
len(G.edges())
2
type(G)
networkx.classes.graph.Graph
Python 網路分析進階

網路視覺化

  • nxviz:建立美觀且合理圖形視覺化的 API

  • 著重節點擺放

第 1 章圖 1.019

Python 網路分析進階

網路視覺化

  • nxviz:建立美觀且合理圖形視覺化的 API

  • 著重節點擺放

第 1 章圖 1.020

Python 網路分析進階

網路視覺化

  • nxviz:建立美觀且合理圖形視覺化的 API

  • 著重節點擺放

第 1 章圖 1.021

Python 網路分析進階

網路視覺化

  • nxviz:建立美觀且合理圖形視覺化的 API

  • 著重節點擺放

第 1 章圖 1.022

Python 網路分析進階

nxviz 基本 API

import nxviz as nv
import matplotlib.pyplot as plt

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

第 1 章圖 1.028

Python 網路分析進階

一起來練習吧!

Python 網路分析進階

Preparing Video For Download...