1
許多顯然與NetworkX一起使用的方法似乎並未導入。例如,根據該網站,我應該能夠使用:缺少python方法NetworkX
的transitive_closure()
方法。
但是當我運行python.py文件,
import networkx as nx
G = nx.DiGraph()
G.add_edges_from([
('a', 'c'),
('b', 'c'),
('c', 'd'),
])
C = nx.transitive_closure(G)
我得到的錯誤
C = nx.transitive_closure(G)
AttributeError: 'module' object has no attribute 'transitive_closure'