There are so many packages that provide this calculation although most of them are based on points and not data frames or maybe I am making a mistake! I have found this method that workers with my panda dataframe of Latitude and Longitude columns:
def haversine(lat1, lon1, lat2, lon2, to_radians=True, earth_radius=6378137):
"""
slightly modified version: of http://stackoverflow.com/a/29546836/2901002
Calculate the great circle distance between two points
on the earth (specified in decimal degrees or in radians)
All (lat, lon) coordinates must have numeric dtypes and be of equal length.
"""
if to_radians:
lat1, lon1, lat2, lon2 = map(np.radians, [lat1, lon1, lat2, lon2])
a = np.sin((lat2-lat1)/2.0)**2 + \
np.cos(lat1) * np.cos(lat2) * np.sin((lon2-lon1)/2.0)**2
return earth_radius * 2 * np.arcsin(np.sqrt(a))
but all initial bearing or azimuths I tried, don't accept the dataframe series and trying the numpy array will still return me zeros! Is there a certain way to do so for a successive rows of a dataframe? I would like to calculate initial bearing between successive points. In R the bearing function will do the job with a dataframe just wondering if there is an equivalent in Python.