Skip to content

Commit 5197cc0

Browse files
authored
[Fix] Fix typo (G.node -> G.nodes)
Fixing typo in Create Edges example code. (G.node -> G.nodes)
1 parent 64e3bc0 commit 5197cc0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/network-graphs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Add edges as disconnected lines in a single trace and nodes as a scatter trace
6363
edge_x = []
6464
edge_y = []
6565
for edge in G.edges():
66-
x0, y0 = G.node[edge[0]]['pos']
67-
x1, y1 = G.node[edge[1]]['pos']
66+
x0, y0 = G.nodes[edge[0]]['pos']
67+
x1, y1 = G.nodes[edge[1]]['pos']
6868
edge_x.append(x0)
6969
edge_x.append(x1)
7070
edge_x.append(None)
@@ -81,7 +81,7 @@ edge_trace = go.Scatter(
8181
node_x = []
8282
node_y = []
8383
for node in G.nodes():
84-
x, y = G.node[node]['pos']
84+
x, y = G.nodes[node]['pos']
8585
node_x.append(x)
8686
node_y.append(y)
8787

0 commit comments

Comments
 (0)