python 列表的并集、交集
list(set(shequ[55]).union(set(shequ_0[55])))#并集
list(set(shequ[55]) & set(shequ_0[60]))#交集
networkx自带数据集:
空手道俱乐部Karate Club
ER随机图Erdos Renyi
度序列Degree Sequence
足球football
import matplotlib.pyplot as plt
import networkx as nx
# 俱乐部数据
G = nx.karate_club_graph()
print("Node Degree")
for v in G:
print('%s %s' % (v, G.degree(v)))
# 画环形,其中节点表示会员
nx.draw_circular(G, with_labels=True)
plt.show()