I have my adjacency matrix as a numpy array and would like to plot it as a simple undirected graph using NetworkX but I keep running into this error: AttributeError: module 'scipy.sparse' has no attribute 'coo_array'
I'm following this: Plot NetworkX Graph from Adjacency Matrix in CSV file particular answer and could not get it to work. The only difference is that my adjacency matrix is rather huge with around 30000 columns
This is my graph drawing code:
G = nx.from_numpy_matrix(np.matrix(adj_mtx_np), create_using=nx.DiGraph)
nx.draw(G)
plt.show()
My scipy version is 1.8.0
downgrade networkx to 2.6.3 and it solved this problem for me.
Upgrade both scipy and networkx and it worked for me.
pip install --upgrade scipy networkx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With