Format for importing edgelist into igraph in python

后端 未结 1 930
温柔的废话
温柔的废话 2021-01-06 21:00

What is the edgelist format accepted by igraph for import into python? What should the textfile that contains my weighted edges look like?

I\'ve used igraph with R

1条回答
  •  萌比男神i
    2021-01-06 21:36

    Get rid of all the commas in your file (i.e. use only whitespace as the separator) and then use Graph.Read_Ncol. This should do the trick. The numeric IDs in your files will be assigned to the name vertex attribute and the edge weights will be stored in the weight edge attribute.

    0 讨论(0)
提交回复
热议问题