I have this code which runs perfectly fine.
G = nx.Graph()
num_row = len(attr_df)
keys = attr_df.columns
attrs = {}
for i in range(num_row):
G.add_node(attr_df['MATNR'][i], PSTAT= attr_df['PSTAT'][i])
and if I was to call
G.nodes()
I would get a long list of all the nodes.
But when I call
G.node[0]
to look at an individual node and its properties, I get:
AttributeError: 'Graph' object has no attribute 'node'