I have a network of nodes created using python networkx. i want to store information in nodes such that i can access the information later based on the node lab
networkx
As of networkx v2.0, you can use:
import networkx as nx G = nx.Graph() G.add_node('abc', dob=1185, pob='usa', dayob='monday') nx.get_node_attributes(G, 'dob') > {'abc': 1185}
You can access this dictionary as usual:
{'abc': 1185}['abc'] > 1185