放大與縮小:整體圖摘要

Python 網路分析進階

Eric Ma

Data Carpentry instructor and author of nxviz package

多尺度圖形探索

  • 全域與區域尺度的探索

  • 全域:中心性分佈

  • 區域:連結性與結構

Python 網路分析進階

放大觀察節點

  • 擷取特定節點或節點集合

  • 繪製節點統計的時間序列

Python 網路分析進階

彙整節點統計的演變

  • 客戶-產品資料集
    • 觀察購買模式隨時間的變化
  • customer1:關注的節點
Python 網路分析進階

彙整節點統計的演變

Gs = [....] 

noi = 'customer1'
degs = []
for g in Gs: ... # Get the degree of the node degs.append(len(g.neighbors(noi)))
plt.plot(degs) plt.show()
Python 網路分析進階

彙整節點統計的演變

ch3-3.020.png

Python 網路分析進階

Defaultdict(預設字典)

from collections import defaultdict
d = defaultdict(list)

d['heathrow'].append(0.31) d['heathrow'].append(0.84)
d
defaultdict(list, {'heathrow': [0.31, 0.84]})
Python 網路分析進階

Defaultdict(預設字典)

d2 = dict()
d2['heathrow'].append(0.31)
KeyError                           Traceback (most recent call last)
<ipython-input-19-291c74368a8f> in <module>()
--> 1 d2['heathrow'].append(0.31)
KeyError: 'heathrow'
Python 網路分析進階

一起來練習吧!

Python 網路分析進階

Preparing Video For Download...