这是一个创建于 2213 天前的主题,其中的信息可能已经有所发展或是发生改变。
第 1 条附言 · 2018-03-31 08:19:45 +08:00
~~~py
import igraph
tedges = []
with open("test.txt", "r") as f:
while 1:
row = f.readline()[:-1]
if not row:
break
row = row.split(" ")
u, v = [i for i in row]
tedges.append((u, v))
g = igraph.Graph.TupleList(tedges, directed=False)
p = g.community_infomap()
Q = g.modularity(p)
print Q
~~~
在 windows 上运行 igraph,结果一直报错“ module has no attribute Graph ”
2 条回复 • 2018-03-30 11:21:47 +08:00
|
|
1
ebingtel 2018-03-30 09:30:13 +08:00
……这不是问问题的方式
|