Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python igraph从文件创建图形_Python_Graph_Igraph - Fatal编程技术网

python igraph从文件创建图形

python igraph从文件创建图形,python,graph,igraph,Python,Graph,Igraph,我正在尝试使用graph.Read_Edgelist方法从存储在文件中的网络创建一个图形。我有以下代码: netFile = open("trades-train.txt",'r') graph = Graph.Read_Edgelist(netFile, directed=True) 我收到以下错误: igraph._igraph.InternalError: Error at src\foreign.c:105: parsing edgelist file failed, Parse er

我正在尝试使用graph.Read_Edgelist方法从存储在文件中的网络创建一个图形。我有以下代码:

netFile = open("trades-train.txt",'r')
graph = Graph.Read_Edgelist(netFile, directed=True)
我收到以下错误:

igraph._igraph.InternalError: Error at src\foreign.c:105: parsing edgelist file failed, Parse error
这是我文件中的一个样本:

7047,1481
1163,1309
6279,2975
2975,6279
这基本上是我的网络边缘列表。知道我为什么会犯这个错误吗

我找不到那样的东西有什么特别之处

谢谢

您需要将“,”替换为空白。显然Graph.Read_Edgelist只将“”理解为文件的分隔符