Given a dictionary like so:
my_map = {\'a\': 1, \'b\': 2}
How can one invert this map to get:
inv_map = {1: \'a\', 2: \'b\'
Try this for python 2.7/3.x
inv_map={}; for i in my_map: inv_map[my_map[i]]=i print inv_map