I can get the output with data_2012['DeathRate '] where there is a space after DeathRate but I can not get the same result without space after the DeathRate i.e, data_2012['DeathRate'] in python.

Have you considered it might be because your key has a space? Look at the following:

>>> data_2012 = {}
>>> data_2012['DeathRate '] = "some data"
>>> data_2012['DeathRate ']
'some data'
>>> data_2012['DeathRate']
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    data_2012['DeathRate']
KeyError: 'DeathRate'
>>> 

You might avoid spurious spaces by using

data_2012[key.strip()] = value