使用commuinity_leading_eigenvector
igraph时,假设已经创建了图表g,如何将图g的权重列表传递给community_leading_eigenvector
?
community_leading_eigenvector(clusters = None,weights = None, arpack_options =无)
答案 0 :(得分:3)
您可以将包含权重的属性名称传递给weights
参数,也可以使用g.es["weight"]
将所有权重检索到列表中,然后将其传递给weights
参数。因此,假设您的权重在weight
边缘属性中
g.community_leading_eigenvector(weights="weight")
g.community_leading_eigenvector(weights=g.es["weight"])