【发布时间】:2016-11-28 04:25:56
【问题描述】:
我正在关注本教程:graph tutorial 在我自己的数据文件中。但我被困在最后一点。代码似乎抛出:
(most recent call last)<ipython-input-193-7227d35394c0> in <module>()
1 for node in links: #loops through each link and changes each dictionary to a tuple so networkx can read in the information
2 edges = node.items()
----> 3 G.add_edge(*edges[0]) #takes the tuple from the list and unpacks the tuples
4
5 nx.draw(G)
TypeError: 'dict_items' object does not support indexing
有解决办法吗?我有点卡住了。
【问题讨论】:
标签: python-3.x csv networkx