-
-
Save amankharwal/57361fe408a54cde36f98bd6c7f2ff48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replacing "United Kingdom with "UK" | |
data.Hotel_Address = data.Hotel_Address.str.replace("United Kingdom", "UK") | |
# Now I will split the address and pick the last word in the address to identify the country | |
data["countries"] = data.Hotel_Address.apply(lambda x: x.split(' ')[-1]) | |
print(data.countries.unique()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment