community icon indicating copy to clipboard operation
community copied to clipboard

Example graph does not work.

Open ashea2nd opened this issue 7 years ago • 2 comments

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()

ashea2nd avatar Aug 16 '16 21:08 ashea2nd

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()

canbax avatar Jan 13 '17 18:01 canbax

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'

gbarm avatar Jan 16 '18 15:01 gbarm