so i have this pandas dataframe that contains a column countries. the thing is that when i return a list of values for that column i get all type of countries. for example:
list_of_values = ['united states','u.s.a','usa','uk','united kingdom','kingdom','can','canada','england','australia']
this is a very short list of those. theres 2000+ values lol. what i want to do is that take that each value and check how valid is given value and if its not replace it with a valid value. for example:
df.replace('u.s.a', 'USA')
now since theres a ton of those weird given values i tried to shorten them by looping through them and checking different ways. like if there is united in given value and its not united kingdom replace it with USA and so on.
And again since theres so many of them ill have to write like 10 if conditions to check every weird value. what i want to know if there is any ANY builtin tool or something like that to help me do that. or even a better algorithmic structure that will make this easier for me.