python中是否有任何示例,如何将文件从* .gml转换为* .edgelist? 谢谢
答案 0 :(得分:4)
In [1]: import networkx as nx
In [2]: g = nx.read_gml('gmlFile.gml')
In [3]: nx.write_edgelist(g, 'edgelistFile.csv', delimiter=',')
<强>文档强>
read_gml(path, encoding='UTF-8', relabel=False)
write_edgelist(G, path, comments='#', delimiter=' ', data=True, encoding='utf-8')[source]