python networkx程序运行错误AttributeError: 'module' object has no attribute 5
networkx什么的都安好了没问题module代码在这http://www.personal.psu.edu/users/h/x/hxc249/code_segment...
networkx什么的都安好了没问题
module代码在这http://www.personal.psu.edu/users/h/x/hxc249/code_segments/independent_cascade.py
同一个目录下我新建了个文件(就是上面代码中间的一段example)调用上面的module文件
import networkx as nx
from icmodel import independent_cascade
DG = nx.DiGraph()
DG.add_edges_from([(1,2), (1,3), (1,5), (2,1), (3,2), (4,2), (4,3), \
(4,6), (5,3), (5,4), (5,6), (6,4), (6,5)], act_prob=0.2)
H = nx.independent_cascade(DG,[6])
为毛提示
Traceback (most recent call last):
File "C:\Python26\191919.py", line 6, in <module>
H = nx.independent_cascade(DG,[6])
AttributeError: 'module' object has no attribute 'independent_cascade'
是没调用成功吗?还是哪里写的不对?应该怎么用。。?求解答 展开
module代码在这http://www.personal.psu.edu/users/h/x/hxc249/code_segments/independent_cascade.py
同一个目录下我新建了个文件(就是上面代码中间的一段example)调用上面的module文件
import networkx as nx
from icmodel import independent_cascade
DG = nx.DiGraph()
DG.add_edges_from([(1,2), (1,3), (1,5), (2,1), (3,2), (4,2), (4,3), \
(4,6), (5,3), (5,4), (5,6), (6,4), (6,5)], act_prob=0.2)
H = nx.independent_cascade(DG,[6])
为毛提示
Traceback (most recent call last):
File "C:\Python26\191919.py", line 6, in <module>
H = nx.independent_cascade(DG,[6])
AttributeError: 'module' object has no attribute 'independent_cascade'
是没调用成功吗?还是哪里写的不对?应该怎么用。。?求解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询