Same value is repeating in the dataframe column while calculating the distance between langitude and longitude . I have created a dynamic column for finding the distance between every source to destination but all the values of each column is repeating.
for a,b,x in zip(df.Longitude,df.Latitude,df.index):
for c,d in zip(df.Longitude,df.Latitude):
df['distance_'+str(x)]=haversine(a,b,c,d)
suppose this is the dataframe
index name lat long
0 a 74.299104 31.481188
1 b 74.351619 39.481188
2 c 73.351619 39.481188
now i want the expected result like this
index name lat long distanceA distanceB distanceC
0 a 74.299104 31.481188 0 4.5 2.4
1 b 74.351619 39.481188 5.7 0 5.8
2 c 73.351619 39.481188 3.8 1.3 0