Skip to content

Instantly share code, notes, and snippets.

@FelixChop
Created August 8, 2018 09:08
Show Gist options
  • Select an option

  • Save FelixChop/e891b174e642f77680450bda61af7ada to your computer and use it in GitHub Desktop.

Select an option

Save FelixChop/e891b174e642f77680450bda61af7ada to your computer and use it in GitHub Desktop.
import networkx as nx
G = nx.from_pandas_edgelist(df=d, source=column_ID, target=column_ID+'_2', edge_attr=column_edge)
G.add_nodes_from(nodes_for_adding=df.ID.tolist())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment