1

please help, this is the code function. I'll post the error i'm getting when I run the function and use 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'])

1 Answers1

1

In continuation with the question above,When I run the code I get a value error. Saying "ValueError: Must be a coordinate pair or Point". The code below.

    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)