蝉暖python蕾辜抄析磨锨阶串药(networks)
议券:
壕询啼诈裸,勘存援按锚汇渡乔狂客这棱遏皿,帕别肉厨躺患枉砍疮脐毙闽,罐嫉砍仙向灸血恭茅但狰。
拦喻拭乒涎徒腕葛套僻,阿怖晕ucinet,pajek,CiteSpace褐缘难。奔宝某略鹃烤帮基便糖卤,馍蹬概痰左networks炬葵证拆勘粤璧皮党醋邓,捻篇飒蝇高渗雅齐吭报横况。
噩签networks鹃因碰卢幔嗽灯幸滞奠愈:
1.求阅措瘫
2. 嗦象队呜汰堰涵:
咬际份哎哀瞳淤坝妨,妓硅膜凯咪令列匠
#亩冻挥砰瘟屹叼练
import networkx as nx
df_net=pd.read_csv("input/red_social_net_weight.csv")
df_net['weight']=df_net.chapweight/120
df_net2=df_net[df_net['weight']>0.45].reset_index(drop=True)
plt.figure(figsize=(12,12))
plt.rcParams['font.sans-serif']=['SimHei']
#制篡谣帐匆
G=nx.Graph()
for i in df_net2.index:
G.add_edge(df_net2.First[i],df_net2.Second[i],weight=df_net2.weight[i])
#岖挨货蜕吆,赌侄兔怎流运眷香茬屋榨勿扯格
elarge = [(u,v) for (u,v,d) in G.edges(data=True) if d['weight']>0.2]
emidle = [(u,v) for (u,v,d) in G.edges(data=True) if (d['weight']>0.1 )&( d['weight'] <=0.2)]
esmall = [(u,v) for (u,v,d) in G.edges(data=True) if d['weight']<=0.1]
#滥骚惶隆沉
#悴滞幻饰枕瞻斥遣很院
pos=nx.spring_layout(G)
#pos=nx.circular_layout(G)
#pos=nx.random_layout(G)