Skip to content

Tag: networkx

Networkx: Network graph from pandas dataframe

I have the following dataset: The dataframe shows when different investment firms have invested in the same Company during a year. I want to create a network graph of the Connections between the Firm_ID only. For example Ampersand and BancBoston have both invested in the same company and should therefore be c…

Contracted nodes automatically in Networkx

I have problem, I wish could automatically merge the nodes by inserting an if condition. I have this dataframe: I created this graph: What I would like is to merge the nodes with Weight <15 and not taking the nodes 10.0.11.100,10.0.12.100,10.0.13.100,10.0.14.100 using an if condition. I tried with this cod…

Creating multiple graphs using gnp_random_graph

While using the NetworkX package I was tasked with creating multiple random graphs with a given n number of nodes and p probability, this is my code: But, every iteration creates the same exact graph (even the edges are completely the same) Does anyone have a clue what might be wrong? Update: After trying to …