Python Forum

Full Version: Convert np Array A to networkx G
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am trying to convert the np array A to networkx G. I have the code "G = nx.from_numpy_array(A)" but I don't know if I need to do anything else to convert array A.

Thanks,
Ian
(Jul-05-2023, 02:34 AM)IanAnderson Wrote: [ -> ]I have the code "G = nx.from_numpy_array(A)"
That's what the documentation is for. It tells you that the numpy array is interpreted as an adjacency matrix.
Ok, thank you