почему я получаю TypeError: Не удалось преобразовать узлы source_node, destination_node для ввода - PullRequest
0 голосов
/ 29 апреля 2020
g=nx.read_edgelist("/content/drive/My Drive/Fb friends recommendation/train.csv",delimiter=',',create_using=nx.DiGraph(),nodetype=int)
print(nx.info(g))

Это код. Так в чем же решение?

ValueError                                Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/networkx/readwrite/edgelist.py in parse_edgelist(lines, comments, delimiter, create_using, nodetype, data)
    263             try:
--> 264                 u = nodetype(u)
    265                 v = nodetype(v)

ValueError: invalid literal for int() with base 10: 'source_node'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
3 frames
<decorator-gen-740> in read_edgelist(path, comments, delimiter, create_using, nodetype, data, edgetype, encoding)

/usr/local/lib/python3.6/dist-packages/networkx/readwrite/edgelist.py in parse_edgelist(lines, comments, delimiter, create_using, nodetype, data)
    266             except:
    267                 raise TypeError("Failed to convert nodes %s,%s to type %s."
--> 268                                 % (u, v, nodetype))
    269 
    270         if len(d) == 0 or data is False:

TypeError: Failed to convert nodes source_node,destination_node to type <class 'int'>.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...