Plot NetworkX Graph with numpy array error

We Are Going To Discuss About Plot NetworkX Graph with numpy array error. So lets Start this Python Article.

Plot NetworkX Graph with numpy array error

  1. How to solve Plot NetworkX Graph with numpy array error

    downgrade networkx to 2.6.3 and it solved this problem for me.

  2. Plot NetworkX Graph with numpy array error

    downgrade networkx to 2.6.3 and it solved this problem for me.

Solution 1

downgrade networkx to 2.6.3 and it solved this problem for me.

Original Author hiroki Of This Content

Solution 2

Upgrade both scipy and networkx and it worked for me.

pip install --upgrade scipy networkx

Original Author lyh458 Of This Content

Solution 3

I looked into the scipy file that was generating that error (“convert_matrix.py”) line 921: A = sp.sparse.coo_array((d, (r, c)), shape=(nlen, nlen), dtype=dtype).

You need to switch “coo_array” to “coo_matrix”.

So it should look like: A = sp.sparse.coo_matrix((d, (r, c)), shape=(nlen, nlen), dtype=dtype)

This worked well enough for me for my project

Original Author cocophelps Of This Content

Solution 4

I encountered the same problem and I used pip install scipy==1.8.1 on a Windows system and it worked! I guess it may be because previous versions of ‘scipy.sparse’ don’t have ‘coo_array’.

I tried the methods in the first answer, but they didn’t work for. I also tried to use conda to update scipy to 1.8.1 to no avail.

Original Author Jayz Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment