pandas replace data in specific columns with specific values

Solutions on MaxInterview for pandas replace data in specific columns with specific values by the best coders in the world

showing results for - "pandas replace data in specific columns with specific values"
Amelie
31 Jul 2017
1### replace one value ###
2df["column"].replace("US","UK") # you can also use numerical values
3### replace more than one value ###
4df["column"].replace(["man","woman","child"],[1,2,3]) # you can also use numerical values
5#   man ==> 1
6# woman ==> 2
7# child ==> 3