import networkx as nximport igraph as ig# networkx转igraph g = nx.karate_club_graph()d = nx.to_pandas_edgelist(g).valuesg = ig.Graph(d)#igraph转networkxt = [str(e[0])+" "+str(e[1]) for e in g.get_edgelist()]f = nx.parse_adjlist(t)print(f.nodes)
python-字符串
时间:2023-08-18
networkx与igraph之间转换
相关推荐