Q:

networkx convert_node_labels_to_integers

Im using python 2.7 and networkx and im using convert_node_labels_to_integers. It does its main job fine.
If i ask it to not discard old labels im not getting what i expected
g = nx.Graph()
g.add_edge('a','b')
g2 = nx.convert_node_labels_to_integers(g, discard_old_labels=False)
print g2[0]

g2[0] has no attributes when i thought it would now have an attribute 'old_labels' with the old label in it.
Am i doing something wrong? Am i misinterpreting how this works? Ive got to be missing something simple.
Thanks

A:

The old labels are stored in a graph attribute - node_labels.
print g2.node_labels
{'a': 0, 'b': 1}

