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

Example graph does not work. #4

Open
ashea2nd opened this issue Aug 16, 2016 · 2 comments
Open

Example graph does not work. #4

ashea2nd opened this issue Aug 16, 2016 · 2 comments

Comments

@ashea2nd
Copy link

Error returned is when I try to follow the example.

Traceback (most recent call last):
File "cmty.py", line 122, in
sys.exit(main(sys.argv))
File "cmty.py", line 116, in main
Orig_deg = UpdateDeg(A, G.nodes())
File "cmty.py", line 64, in UpdateDeg
n = len(nodes) #len(A) ---> some ppl get issues when trying len() on sparse matrixes!
TypeError: object of type 'generator' has no len()

@canbax
Copy link

canbax commented Jan 13, 2017

It's about your version of networkx. Use 1.10 version. this version returns a list. Some versions might return a generator which has no len()

@gbarm
Copy link

gbarm commented Jan 16, 2018

Hi, I got something similar I have version 2.0 of networkx
Traceback (most recent call last):
File "/Users/gba/cmty.py", line 122, in
sys.exit(main(sys.argv))
File "/Users/gba/cmty.py", line 116, in main
Orig_deg = UpdateDeg(A, G.nodes())
File "/Users/gba/cmty.py", line 67, in UpdateDeg
deg_dict[nodes[i]] = B[i, 0]
TypeError: unhashable type: 'dict'

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

3 participants