I originally has a dictionary like the following:
mydict = {int(i): 'values' for i in range(5)}
{0: 'values', 1: 'values', 2: 'values', 3: 'values', 4: 'values'} # output
then i removed two of the index:
del mydict[0]
del mydict[3]
{1: 'values', 2: 'values', 4: 'values'} # output
And now i would like to "reindex" the dictionary into something like:
{0: 'values', 1: 'values', 2: 'values'} # output
my real dictionary are much larger than this so it is not possible to do it manually..