I had a similar problem, since the places I had listed on a column needed to be standardized. First I tried to give a list as key and the standard word as value, which of course failed. So, I made a function to expand the values on the list as keys, and assign the standard word as value for all of them:
def list_to_dict(cities):
new_dict = {}
for key in cities:
value = cities[key]
for item in value:
new_dict[item] = key
return new_dict
With this, I got to clean this list of words aimed to mean Mexico City in Spanish (of course my set is larger and for more places, but this is an illustrative sub-group):
ciudades = list_to_dict({'Ciudad De Mexico' : ['Ciudad De México', 'Cuajimalpa De Morelos', 'Mexicocity', 'Ciudad De Mexico', 'Miguel Hidalgo, Cdmx', 'Df', 'Cmx', 'Ciudad De M', 'Cdmx', 'Ciudad De M?Xico', 'C.D. M.X,', 'Mx-Cdm', 'Cuidad De Mexico', 'Dif', 'D.F.', 'D.F', 'DF', 'Distrito', 'Mexico City', 'Coyoacan', 'Mx-Cdm', 'Cdmex', 'Mx-Dif', 'Mexico Df', 'Ciudad_De_M']}
Resulting in:
