简体   繁体   English

如何在networkx edgelist中添加评论?

[英]How to add comments to networkx edgelist?

Network has a function nx.write_edgelist(G, path, comments='#', delimiter=' ', data=True, encoding='utf-8') . 网络具有功能nx.write_edgelist(G, path, comments='#', delimiter=' ', data=True, encoding='utf-8')

I'd like to add some comments to the graph I created. 我想在创建的图形中添加一些注释。 However, it turns out that the argument comments is of no use in this case. 但是,事实证明,在这种情况下,参数comments没有用。 When the following command is executed: 当执行以下命令时:

nx.write_edgelist(my_graph,my_path,comments="#some comments",data=False);

Nothing related to the comments is written to the output file. 与注释无关的任何内容都不会写入输出文件。 Is there any way that I can add comments to an edgelist other than create an edgelist and add the comments mannually (or writing a program to add the comments after the edgelist file is created). 除了创建边缘列表并手动添加注释(或在创建边缘列表文件后编写程序以添加注释)之外,是否可以通过其他任何方式将注释添加到边缘列表。

从Networkx 2.0开始, nx.write_edgelist函数中的参数comments没有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM