zzz24512653 / CommunityDetection

Implements of community detection algorithms
354 stars 174 forks source link

'Graph' object has no attribute 'node' #17

Open MagiSuCoder opened 4 years ago

MagiSuCoder commented 4 years ago

你好,请问运行LFM算法,报错“'Graph' object has no attribute 'node'”,是什么问题呀?

langyayue99 commented 4 years ago

这是因为networkx不再支持G.node,现在支持方法G.nodes。

BreezeWind-warning commented 4 years ago

这是因为networkx不再支持G.node,现在支持方法G.nodes。

改完nodes之后还是报错。 报错为:'KeysView' object is not subscriptable

出错语句在这:

in execute(self) 7 def execute(self): 8 communities = [] ----> 9 node_not_include = self._G.nodes().keys()[:] 10 while(len(node_not_include) != 0): 11 c = Community(self._G, self._alpha)