When working with geospatial object, geopy makes it easy for Python developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources.
Each geolocation service (like Nominatim) has its own class in geopy.geocoders. (you can write anything in user_agent)
Geocoders each define at least a geocode method, for resolving a location from a string, and may define a reverse method, which resolves a pair of coordinates to an address. For certain locations, you can also change the language (en = English, jp = Japanese).
Geopy can calculate geodesic distance between two points with a default of the geodesic distance available as the function geopy.distance.distance.
In this code, we will try to get the number of location that is in Sendai city.
We first delay our Geocoding 0.5 second between each address. When the number of data is too many, Geolocator might reject your request. Try to increase the number of second if that happens.
We will be using str accessor, str.contains(), to check whether our string contains a particular substring or not.
The csv contains several locations. Find out how many of those locations are in 宮城県 and how many are in 山形県。