Python igraph社区\最优\模块化不带权重参数

Python igraph社区\最优\模块化不带权重参数,python,graph,igraph,modularity,weighted,Python,Graph,Igraph,Modularity,Weighted,我尝试在python中使用igraph中的community_optimal_模块化函数。文件 声称关键词“权重”将考虑边权。 不幸的是,它似乎没有: import numpy as np import igraph gra = igraph.Graph.Full(10) gra.es["weight"] = np.random.rand(gra.ecount()) gra.community_optimal_modularity(weights="weight") 导致“communit

我尝试在python中使用igraph中的community_optimal_模块化函数。文件

声称关键词“权重”将考虑边权。

不幸的是,它似乎没有:

import numpy as np
import igraph
gra = igraph.Graph.Full(10)
gra.es["weight"] = np.random.rand(gra.ecount())
gra.community_optimal_modularity(weights="weight")
导致“community_optimal_modularity()不接受任何参数(给定1)”,而相同的代码在没有最后一个命令的关键字规范的情况下工作。我使用的是igraph版本0.7.0,这是最新的版本

<> P>是否可以通过最优模块化来考虑社区检测中的权重??

< P>尝试:

gra.community_optimal_modularity(weights= gra.es["weight"])

为我工作。

您确定使用的是0.7.0版吗?igraph._版本_说什么?'0.7',对不起,我假设这是0.7.0