assigning items of a list to the nodes of a graph

So if I get you right, I think you should do this

for i in G.nodes():
    for elem in r_list[:]:
        G.nodes[i]['politic'] = elem
        r_list.remove(elem)
        continue

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top