I've a large dataset with an address column. I would like to extract the countries from the address. In many cases, the address column contains states, cities, and zip code, but the country names. You can see samples of my data
I'm using python, How I can extract the country name in all these cases.
There are two ways according which I would go ahead and try to find the country name.
You can refer to Google Geocoding API here.
And use the python geocoder library to find the details. (Install it via pip install geocoder
)
import geocoder
results = geocoder.google("Delhi")
print(results.current_result)
P.S You might have to set your API key first.