networkx / nx-guides

Examples and Jupyter Notebooks about NetworkX
https://networkx.org/nx-guides/
Creative Commons Zero v1.0 Universal
188 stars 104 forks source link

Minor error in edge indexes printing #9

Open gautier-laurent opened 4 years ago

gautier-laurent commented 4 years ago

Hi, I think there is a somewhat minor error in the entry [39]. The printed indexes are those of the previous cell, if I understood correctly.

This piece of code:

for (u, v, d) in FG.edges(data='weight'):
    if d < 0.5:
        print('(%d, %d, %.3f)'%(n, nbr, d))

should be:

for (u, v, d) in FG.edges(data='weight'):
    if d < 0.5:
        print('(%d, %d, %.3f)'%(u, v, d))

Thanks for the great tutorial.

Gautier

dschult commented 4 years ago

Yes, input 39 of the tutorial should indeed use (u, v, d). Thanks very much!