I try to calculate distances between two points in spherical coord.
There are two latitude and longitude array which size is around 1100000
lat = [-10, 10, 1, 82, ..., -72]
lon = [120, -58, 13, 22, ..., 122]
Also, there is a standard point
loc_lat = -60
loc_lon = -50
so I try to calculate using below code, but It takes too much time. Is there any efficient way ?
from geopy import distance
D_from_loc = [distance.distance((lat[i], lon[i]), (loc_lat, loc_lon)).km for i in range(len(lon))]