Python – igraph: how to use add_edges when there are attributes

igraphpython

What if I need to create a graph in igraph and add a bunch of edges, but the edges have associated attributes? It looks like .add_edges can only take a list of edges without attributes, so I've been adding them one by one with .add_edge

Best Answer

graph.add_edge('A','B',weight = 20)

Here A and B are names of nodes