Search code examples
pythonpython-3.xgraphnetworkx

AttributeError: module 'networkx' has no attribute 'from_numpy_matrix'


A is co occurrence dataframe. Why it shown AttributeError: module 'networkx' has no attribute 'from_numpy_matrix'

import numpy as np
import networkx as nx
import matplotlib
A=np.matrix(coocc)
G=nx.from_numpy_matrix(A)

Solution

  • It was updated to nx.from_numpy_array(A)