Python Forum
Convert np Array A to networkx G
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert np Array A to networkx G
#1
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
Reply
#2
(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.
Reply
#3
Ok, thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 5,914 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  'networkx' Questions Trader 0 756 Dec-29-2022, 10:20 PM
Last Post: Trader
  networkx package is not visible in singularity container image erdemath 11 2,303 Oct-14-2022, 12:04 PM
Last Post: Larz60+
  Python Networkx: Visualize an edge weight with a bubble/circle uvw 0 2,010 Sep-01-2021, 06:26 AM
Last Post: uvw
  Convert String of an int array to a Numpy array of ints mdsousa 5 5,707 Apr-08-2021, 08:00 PM
Last Post: mdsousa
  convert array of numbers to byte array adetheheat 3 2,817 Aug-13-2020, 05:09 PM
Last Post: bowlofred
  Convert even byte array to odd medatib531 1 2,226 Mar-17-2020, 02:48 AM
Last Post: scidam
  convert a json file to a python dictionnary of array Reims 2 2,256 Sep-10-2019, 01:08 PM
Last Post: Reims
  Reproducing assignment with min cost flow in networkx mntfr 0 2,137 Jun-13-2019, 04:06 PM
Last Post: mntfr
  Python convert csv to json with nested array without pandas terrydidi 2 9,691 Jan-12-2019, 02:25 AM
Last Post: terrydidi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020