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

force-ipython notebook - AttributeError: 'matrix' object has no attribute 'todense' #1

Open
micahstubbs opened this issue Feb 6, 2015 · 6 comments

Comments

@micahstubbs
Copy link

screen shot 2015-02-06 at 16 12 53

@micahstubbs
Copy link
Author

@freeman-lab
Copy link
Member

What version of networkx do you have? You can check by

import networkx as nx
nx.__version__

With v1.9.1, the example runs fine, and the output of nx.adjacency_matrix(G) appears to be a sparse matrix, whereas the error you see implies it is a normal numpy matrix. A tricky thing with notebooks is that you can't force required versions of libraries used, but we could specify a version requirement for this notebook for networkx if that's indeed the issue.

@micahstubbs
Copy link
Author

'1.7'

@micahstubbs
Copy link
Author

I ran

$ pip install networkx --upgrade

after that I show version

'1.9.1'

@micahstubbs
Copy link
Author

after upgrading networkx from version '1.7' that came with my Anaconda distribution to '1.9.1' it works!

screen shot 2015-03-22 at 18 53 56

@micahstubbs
Copy link
Author

// could specify a version requirement for this notebook for networkx

this looks like a good idea.

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

2 participants