Return the neighbors of node n. Use “G[n]”.
Notes
G[n] is similar to G.neighbors(n) but the internal data dictionary is returned instead of a list.
G[u][v] returns the edge data for edge (u,v).
>>> G=nx.path_graph(4)
>>> print G[0][1]
1
Assigning G[u][v] may corrupt the graph data structure.
Examples
>>> G=nx.path_graph(4)
>>> print G[0]
{1: 1}