I am sorry if this is a too basic question however I am unable to understand a simple error that geopy is throwing at me.
In [78]: import geopy
In [79]: geopy.geocoders.Nominatim.geocode("Mumbai")
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-79-2465009b9d72> in <module>()
----> 1 geopy.geocoders.Nominatim.geocode("Mumbai")
TypeError: geocode() missing 1 required positional argument: 'query'
However, the following works and I am not getting how these two approaches are different:
In [83]: from geopy.geocoders import Nominatim
In [84]: geolocator = Nominatim()
In [85]: geolocator.geocode("Mumbai")
Out[85]: Location(Mumbai, Greater Bombay, Maharashtra, India, (18.9321862, 72.8308337, 0.0))
As far as I can see, both seem to be equivalent. What am I missing?