放大与缩小:整体图概览

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 网络分析中级

默认字典

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 网络分析中级

默认字典

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...