Skip to content

Qusetion:How to input weight graph? #109

Open
@jichao-ren

Description

@jichao-ren

Hello!
I would like to try to apply this algorithm to the user user weight graph to represent each user node by vector. At present, I use the three column saving method, < user_ node1 user_ node2 weight_ float> .However, the current display prompt is as follows:

Input:
0 11 0.8750
0 29 0.7170
0 61 0.6480
0 76 1.0000
0 79 1.9340
0 91 0.3680
0 92 1.0000

File "D:\Anaconda3\lib\site-packages\networkx\readwrite\edgelist.py", line 277, in parse_edgelist
edgedata = dict(literal_eval(' '.join(d)))
TypeError: 'float' object is not iterable
File "E:/node2vec04/node2vec/src/main.py", line 91, in read_graph
G = nx.read_edgelist(args.input, nodetype=int, create_using=nx.DiGraph())
File "<D:\Anaconda3\lib\site-packages\decorator.py:decorator-gen-584>", line 2, in read_edgelist
File "D:\Anaconda3\lib\site-packages\networkx\utils\decorators.py", line 240, in _open_file
result = func_to_be_decorated(*new_args, **kwargs)
File "D:\Anaconda3\lib\site-packages\networkx\readwrite\edgelist.py", line 369, in read_edgelist
data=data)
File "D:\Anaconda3\lib\site-packages\networkx\readwrite\edgelist.py", line 280, in parse_edgelist
"Failed to convert edge data (%s) to dictionary." % (d))
TypeError: Failed to convert edge data (['0.8750']) to dictionary.

Thank you very much in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions