【发布时间】:2019-10-29 06:24:05
【问题描述】:
我正在尝试可视化网络。信息是从 .csv 文件中读取的。所有节点都是列表中的对象。对象也包含一个列表。我一直遇到 TypeError 错误:TypeError: list indices must be integers or slices, not Router
我尝试在第二个 for 循环中进行转换,各种循环,但每当我尝试第二个循环时,它就会中断
将节点之间的边添加到网络
for a in node_list:
for e in node_list[a].dst:
ams_net.add_edge(node_list[e].name, node_list[e].dst[e])
我需要它遍历 node_list 中的所有节点,并且必须为每个目的地创建一个具有“边缘”的节点...
【问题讨论】: