Created
February 9, 2020 13:50
-
-
Save WouterNieuwerth/9339cbeb3c75ee94b17f669b682d5a70 to your computer and use it in GitHub Desktop.
GPX analysis - step 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculate distances and time deltas | |
df['distance_dis_2d'] = df.apply(lambda x: distance.distance((x['lat-start'], x['lon-start']), (x['lat'], x['lon'])).m, axis = 1) | |
df['alt_dif'] = df.apply(lambda x: x['alt-start'] - x['alt'], axis=1) | |
df['distance_dis_3d'] = df.apply(lambda x: sqrt(x['distance_dis_2d']**2 + (x['alt_dif'])**2), axis=1) | |
df['time_delta'] = df.apply(lambda x: (x['time'] - x['time-start']).total_seconds(), axis=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment