我在使用Python中的igraph时遇到了删除多个边的问题。
我尝试过以下方法,但没有成功:
for e in g.es:
if e.is_multiple() is True:
g.es.delete(e)
我甚至尝试过
for e in g.es:
if e.is_multiple() is True:
helptuple = e.tuple
source = helptuple[0]
target = helptuple[1]
eid = g.get_eid(source, target)
g.delete_edges(eid)
还有其他解决方案吗?
if not edge in edgelist: g.add_edge(e)
- bioinfo_programer