📅  最后修改于: 2022-03-11 14:45:20.046000             🧑  作者: Mango
import networkx as nx
G = nx.from_pandas_edgelist(df, 'node_1', 'node_2')
print(G.number_of_nodes())
print(G.number_of_edges())