Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@manekgarg
Created May 24, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manekgarg/d6510cdd3ebcc991d2bcd2558ba57337 to your computer and use it in GitHub Desktop.
Save manekgarg/d6510cdd3ebcc991d2bcd2558ba57337 to your computer and use it in GitHub Desktop.
# Attribute enrichment of the nodes
node_attr = pd.read_csv('/content/quakers_nodelist.csv', index_col = 'Name')
node_attr
# Add the atribute to the graph G
node_attr_d = node_attr.to_dict(orient = 'index')
nx.classes.function.set_node_attributes(G, node_attr_d)
nx.get_node_attributes(G, 'age')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment