I have a df with 3 people ("members") and I would like to measure the distance of these people from 3 locations. The end result would be a df ranking the 3 locations from closest to farther for all 3 people. I have the geocoordinates for all 3 people and all 3 locations and this is what I've tried so far but I don't know how to finish the loop to concatenate the frames to a master frame. Please help!:
df = []
df_2 = []
for m in range(len(members)):
    df_temp_member = pd.DataFrame({'member_id': members.iloc[[m]]['member_id']
                                   })
    for s in range(len(locations)):
        dist = haversine(lon1 = members.iloc[[m]]['longitude']
                        ,lat1 = members.iloc[[m]]['latitude']
                        ,lon2 = locations.iloc[[s]]['Longitude']
                        ,lat2 = locations.iloc[[s]]['Latitude'])
        df_temp = pd.DataFrame({'location_name': locations.iloc[[s]]['location_name'],
                                'Distance': dist,
                                })
        df.append(df_temp)
    df = pd.concat(df)
    df = df.sort_values(by='Distance', ascending=True, na_position='first').reset_index(drop = True).reset_index(drop = True)
    df_temp_1 = pd.DataFrame({'location_1': df.iloc[[0]]['location_name'],
                              'Distance_1': df.iloc[[0]]['Distance'],
                               })
    df_temp_2 = pd.DataFrame({'location_2': df.iloc[[1]]['location_name'].reset_index(drop = True),
                              'Distance_2': df.iloc[[1]]['Distance'].reset_index(drop = True),
                               })
    df_temp_3 = pd.DataFrame({'location_3': df.iloc[[2]]['location_name'].reset_index(drop = True),
                              'Distance_3': df.iloc[[2]]['Distance'].reset_index(drop = True),
                               })
    
    frames = [df_temp_1, df_temp_2, df_temp_3]
    df_2 = pd.concat(frames, axis = 1)
 
    