1

我正在尝试将 pajek 格式 .net 的网络加载到 python 中的图形中。这似乎是一项简单的任务,但我收到了一个我不明白的错误:

Traceback (most recent call last):
   File "insta.py", line 4, in <module>
      G = nx.read_pajek("instaedges.net")
   File "<decorator-gen-588>", line 2, in read_pajek
   File "C:\Users\Marcin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\networkx\utils\decorators.py", line 240, in _open_file
      result = func_to_be_decorated(*new_args, **kwargs)
   File "C:\Users\Marcin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\networkx\pajek.py", line 163, in read_pajek
      return parse_pajek(lines)
   File "C:\Users\Marcin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\networkx\readwrite\pajek.py", line 205, in parse_pajek
      l, nnodes = l.split()
ValueError: too many values to unpack (expected 2)

我的代码:

import networkx as nx
G = nx.read_pajek("instaedges.net")
print(nx.info(G))

这里有什么问题?我正在使用 NetworkX 2.2 和 python 3.7.0

4

0 回答 0