gephi和python_如何用Python创建Gephi网络图?

I have just found out about GephiStreamer. https://pypi.python.org/pypi/GephiStreamer

Using this package one can send instructions from python to Gephi to create nodes and edges in Gephi.

# Create a node with a custom_property

node_a = graph.Node("A",custom_property=1)

# Create edge

edge_ab = graph.Edge(node_a,node_b,custom_property="hello")

stream.add_edge(edge_ab)

Similarly I want to do everything in Gephi through Python. Here is what I typically do.

ex:

steps:

load nodes

load edges

calculate betweeness centrality

change the size/color of nodes as per their centrality scores

change the graph layout (such as forceatlas2)

give the output graph

Below is the output I have got manually, but I want to produce the same by sending instructions from python to Gephi. Documentation doesn't tell anything beyond creating nodes, edges and graphs.

This is slightly better than gephistramer, but this requires python 3.4 or higher and most of the packages like pandas, numpy or sickit are in 2.7.

also Is there a way to send the file I have created in gephi back to python.

Please suggest.

PS: I have edited the entire question details so that it's easier to understand now (hopefully).

解决方案

I found this question while looking for the answer myself. I picked Gephi as my visualizer and then wanted to build a graph that was well supported by the tool by pulling data from around my org with Python.

I found GephiStreamer and it looks a simple yet comprehensive way to build graphs in Gephi from an external python environment (command line, or IDE)

The other options at this point are:

Any of the python GEFX writers (Google "python GEFX")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值