title: Geocoding using Geopy ArcGIS and Python
body: <p>I am trying to geocode multipe address using Geopy and ArcGIS. I have set up my code to loop through the CSV and check for the address and name and provide a separate column for the lat and long coordinates. </p>
  
  <p>This something wrong with my code when executed it does not provide the lat long coordinates and also does not properly loop through the CSV. How do I make it that the it will loop through the multiple address and geocode them giving a lat and long coordinates. </p>
  
  <p>Below is my code:</p>
  
  <pre><code>import csv
  from geopy.geocoders import ArcGIS
  
  
  geolocator = ArcGIS() #here some parameters are needed
  
  with open('C:/Users/v-albaut/Desktop/Test_Geo.csv', 'rb') as csvinput:
      with open('output.csv', 'w') as csvoutput:
         output_fieldnames = ['Name','Address', 'Latitude', 'Longitude']
     writer = csv.DictWriter(csvoutput, delimiter=',', fieldnames=output_fieldnames)
     reader = csv.DictReader(csvinput)
     for row in reader:
          ##here you have to replace the dict item by your csv column names
          query = ','.join(str(x) for x in (row['Name'], row['Address']))
          Address, (latitude, longitude) = geolocator.geocode(query)
          ###here is the writing section
          output_row = {}
          output_row['Name'] = Name
          output_row['Address'] = Address
          output_row['Latitude'] = Latitude
          output_row['Longitude'] =Longitude
          writer.writerow(output_row)
  </code></pre>