我正在尝试将pajek格式的网络加载到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))
这里有什么问题? 我正在使用networkx2.2和python3.7.0
目前没有回答
相关问题 更多 >
编程相关推荐