admin管理员组文章数量:1596345
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops'
目录
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops'
#问题
#解决
#完整错误
#问题
import networkx as nx
edges = [(1, 2), (1, 6), (2, 3), (2, 4), (2, 6),(3, 4), (3, 5), (4, 8), (4, 9), (6, 7)]
G.add_edges_from(edges)
nx.draw_networkx(G)
print("Total number of nodes: ", int(G.number_of_nodes()))
print("Total number of edges: ", int(G.number_of_edges()))
print("List of all nodes: ", list(G.nodes()))
print("List of all edges: ", list(G.edges(data = True)))
print("Degree for all nodes: ", dict
本文标签: GraphAttributeErrorobjectnumberofselfloopsattribute
版权声明:本文标题:解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘ 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1728256673a1151101.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论