Answers for "networkx create graph from dataframe"

0

networkx create graph from dataframe

import networkx as nx

G = nx.from_pandas_edgelist(df, 'node_1', 'node_2')
print(G.number_of_nodes())
print(G.number_of_edges())
Posted by: Guest on July-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language