是我遗漏了什么,还是这是Gephi脚本控制台中的一个奇怪的错误?在
控制台显示边,但不显示节点
例如
>>> len(g.edges)
4314
>>> len(g.nodes)
1
>>> g.edges
set([e8926, e8794, e7024 ......])
>>> g.nodes
set([None])
您可以使用datasetPower复制错误网格.gml配备Gephi。
我在来自here for example 的几个数据集上测试了这一点,得到了相同的错误。在
我做错什么了吗?在
Tags:
现在,在最初的问题两年后,这个bug仍然存在,在Gephi的Jython控制台中:
但是,我找到了一种解决方法,可以通过脚本控制台直接操作节点,如下所示:
^{pr2}$通过这样做,我可以像这样操纵节点属性:
下面是我用python编写的一个脚本,用于在完成user1290329在这里所做的操作之后,如果您在恢复边缘位置时遇到困难[https://stackoverflow.com/a/15827459/1645451]
这基本上会将gephi创建的integer Id列映射到edges表。在
现在在gephi数据实验室中,导入电子表格,确保选择了edges选项,然后单击choose the‘edges’formatted_for_盖菲.csv,取消选中createmissing nodes,您的边应该回到gephi图中。:)
有一个名为“数据表”的插件,当你安装它时,你可以看到你的数据集的结构。 我遇到了一个完全一样的问题,我理解了节点id是一个字符串而不是一个数字。如果你想在控制台脚本插件中看到脚本插件executeg.nodes()命令的区别,你可以看到(从“数据表”插件)新创建的节点的id是一个数字而不是字符串。当您在Gephi控制台中执行g.nodes或len(g.nodes)时,您可以看到新创建的节点。 我是这样解决的: 我安装了一个名为“Data Table”的插件,在can“Export Table”中选择它,它告诉你需要导出哪些列,你可以选择任何你想要的,而不是Id,然后选择一个分隔符,按Ok它就会保存它。创建一个新的项目,打开“数据表”插件,然后单击“导入电子表格”,从这里你可以插入一个名为“Id”的新列的数据集,gephi自己把它添加到你的数据集中
相关问题 更多 >
编程相关推荐