Я изучаю python, так что это может показаться простым, я пытаюсь запустить код ниже, но я продолжаю получать сообщение об ошибке, любые мысли о том, что может быть причиной этого?Ошибка Python - IndexError: индекс индекса вне диапазона
from geopy import geocoders
import csv
g_api_key = 'my_google_api_key'
g = geocoders.GoogleV3(g_api_key)
costco = csv.reader (open('costcolimited.csv'), delimiter = ',')
# Print header
print "Address, City, State, Zip Code, Latitude, Longitude"
for row in costco:
full_addy = row[1]+ "," + row[2]+ "," + row[3] + "," + row[4]
place, (lat,lng) = list (g.geocode(full_addy, exactly_one=FALSE))[0]
full_addy + "," + str(lat) + "," + str(lng)
Ошибка я получаю
Traceback (most recent call last):
File "C:\Python27\geocodelocations.py", line 12, in <module>
full_addy = row[1]+ "," + row[2]+ "," + row[3] + "," + row[4]
IndexError: list index out of range
Помните, что первый элемент в '' row' является строка [0] ',' не строка [1] '. – apnorton