0

I have a python code:

for i in edges_list:
        i = i.to_string()
        i = i.replace("->", ",")
        i = i.replace("[", ",")
        i = i.replace("];" , "")
        G1.add_edge(i)

When I execute it, I get the error: TypeError: add_edge() takes at least 3 arguments (2 given)

i is of the form 5 , 15 , color="#0000FF" If I did G1.add_edge(5 , 15 , color="#0000FF") I'm not getting any error. However, when I pass it as string I get that error.

I tried i.split('"\'') bu it didn't resolve the problem. What to do?

Jab
  • 119
  • 1
  • 2
  • 17

0 Answers0