Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qusetion:How to input weight graph? #109

Open
jichao-ren opened this issue Mar 19, 2021 · 0 comments
Open

Qusetion:How to input weight graph? #109

jichao-ren opened this issue Mar 19, 2021 · 0 comments

Comments

@jichao-ren
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant