networkx.to_numpy_matrix
networkx.to_scipy_sparse_matrix
Enter search terms or a module, class or function name.
Return a graph from numpy matrix adjacency list.
A : numpy matrix
An adjacency matrix representation of a graph
create_using : NetworkX graph
Use specified graph for result. The default is Graph()
Examples
>>> import numpy >>> A=numpy.matrix([[1,1],[2,1]]) >>> G=nx.from_numpy_matrix(A)