Hi everyone,
I am getting this error when trying to populate nodes with attributes.
The Trace error refers to line 19 of this cell. Please advise Thanks Chris
Line withe trace error
--> 19 nx.draw_networkx_edge_labels(G, pos=pos, labels = edge_labels)
here is a the cell as well
uk_places.nodes['London']['population'] = 8000000
uk_places.nodes['Manchester']['population'] = 5000000
uk_places.nodes['Leeds']['population'] = 470000
view_graph(uk_places)
Nodes in graph: ['London', 'Manchester', 'Leeds']
Edges in graph: [('London', 'Manchester'), ('London', 'Leeds'), ('Manchester', 'Leeds')]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-90-0323bcce71b0> in <module>
2 uk_places.nodes['Manchester']['population'] = 5000000
3 uk_places.nodes['Leeds']['population'] = 470000
----> 4 view_graph(uk_places)
<ipython-input-30-d3b0875fb448> in view_graph(G)
17 if len(nx.get_edge_attributes(G,'distance')) != 0:
18 edge_labels = nx.get_edge_attributes(G, 'distance')
---> 19 nx.draw_networkx_edge_labels(G, pos=pos, labels = edge_labels)
20 plt.figure(figsize=(12,12))
21 plt.show()
TypeError: draw_networkx_edge_labels() got an unexpected keyword argument 'labels'