0
不知道为什么会发生这种情况,当我尝试获取位置信息。我的样本CSV具有以下Python geopy接受手动字符串,但不通过CSV循环时df
address,city,state,zip
767 5th Ave, New York, NY, 10153
和我的Python文件看起来像这样,我在那里我有一个问题
from geopy.geocoders import Nominatim
geolocator = Nominatim()
import pandas as pd
df = pd.read_csv('test.csv')
for index, row in df.iterrows():
# doesnt work when looping
location = geolocator.geocode(row['address'],row['city'],row['state'],row['zip'])
# works manually
#location = geolocator.geocode("767 5th Ave, New York, NY, 10153")
print(location.raw)
不是这些同样包括评论?