You can use regular expressions:
import re
for index, data in enumerate(tmp):
for key, value in word_list.iteritems():
if key in data:
pattern = '\b' + key + '\b'
data = re.sub(pattern, value, data)
tmp[index] = data
Note: you need a string data = ...(to overwrite a variable data), otherwise it will not work correctly if it word_listcontains several records.
source
share