这是一个能够反转加州住房数据集中的坐标以获得特定地址的函数.但我有个问题



请帮忙,这是代码函数。当我运行函数并使用pickle.dump 时,我会发布我得到的错误

def location(cord):
latitude=str(cord[0])
longitude=str(cord[1])
location=geolocater.reverse("{}, {}".format(latitude, longitude) ).raw['address']
#if the values are missing replace by empty string
if location.get('Road') is None:
location['Road'] = None

if location.get('County') is None:
location['County'] = None

loc_update['County'].append(location['County'])
[enter image description here][1]loc_update['Road'].append(location['Road'])

继续上面的问题,当我运行代码时,我得到一个值错误。说"ValueError:必须是一个坐标对或点;。下面的代码。

loc_update = {'County':[],
"Road":[],
"Neighbourhood":[]}
for i,cord in enumerate(df.iloc[:,6:-1].values):
location(cord)
#countiounsly reading our data and saving it on the go
pickle.dump(loc_update, open('loc_update.pickle', 'wb'))
if i%100 == 0:
print(i)

最新更新