I have networkx v. 2.1. to make it work w/ pandas dataframe, i tried following:
networkx v. 2.1
pip3
This solution helps as well:
G = nx.DiGraph() G.add_weighted_edges_from([tuple(x) for x in x.values]) nx.info(G) 'Name: \nType: DiGraph\nNumber of nodes: 5713\nNumber of edges: 5000\nAverage in degree: 0.8752\nAverage out degree: 0.8752'