Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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())
 
PREVIOUS NEXT
Tagged: #networkx #create #graph #dataframe
ADD COMMENT
Topic
Name
9+3 =