CommunityDetection icon indicating copy to clipboard operation
CommunityDetection copied to clipboard

'Graph' object has no attribute 'node'

Open MagiSuCoder opened this issue 5 years ago • 2 comments

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

MagiSuCoder avatar Jan 01 '20 08:01 MagiSuCoder

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

langyayue99 avatar Jun 08 '20 03:06 langyayue99

这是因为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)

BreezeWind-warning avatar Jun 25 '20 07:06 BreezeWind-warning