Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 629530b

Browse files
Merge pull request #4 from shadab-entrepreneur/patch-1
Update Chapter 1 - Introduction to networks.py
2 parents 72877d8 + 2695e64 commit 629530b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎Network Analysis in Python (Part 1)/Chapter 1 - Introduction to networks.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
#---------=======================================================--------------%
2525
# Specifying a weight on edges
2626
# Set the weight of the edge
27-
T.edge[1][10]['weight'] = 2
27+
T.edges[1, 10]['weight'] = 2
2828

2929
# Iterate over all the edges (with metadata)
3030
for u, v, d in T.edges(data=True):
3131

3232
# Check if node 293 is involved
3333
if 293 in [u, v]:
34-
34+
3535
# Set the weight to 1.1
36-
T.edge[u][v]['weight'] = 1.1
36+
T.edges[u, v]['weight'] = 1.1
3737

3838

3939
#---------=======================================================--------------%
@@ -161,4 +161,4 @@ def find_selfloop_nodes(G):
161161

162162

163163

164-
#---------=======================================================--------------%
164+
#---------=======================================================--------------%

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /