個案研究!

Python 網路分析入門

Eric Ma

Data Carpentry instructor and author of nxviz package

資料

  • GitHub 使用者協作網路
  • 節點:使用者
  • 邊:在同一個 GitHub 儲存庫上的協作
  • 目標:
    • 分析結構
    • 視覺化
    • 建立簡易推薦系統
Python 網路分析入門

圖的性質

import networkx as nx
G = nx.erdos_renyi_graph(n=20, p=0.2)

len(G.edges())
29
len(G.nodes())
20
Python 網路分析入門

圖的性質

nx.degree_centrality(G)
{0: 0.15789473684210525,
 1: 0.15789473684210525,
 2: 0.15789473684210525,
 3: 0.10526315789473684,...
nx.betweenness_centrality(G)
{0: 0.01949317738791423,
 1: 0.060916179337231965,
 2: 0.1276803118908382,
 3: 0.03313840155945419,...
Python 網路分析入門

資料

  • 節點數
  • 邊數
  • 度中心性分佈
  • 介數中心性分佈
Python 網路分析入門

一起來練習吧!

Python 網路分析入門

Preparing Video For Download...