Skip to content

Instantly share code, notes, and snippets.

View squeezer44's full-sized avatar
🎯
Focusing

Christian Matthees squeezer44

🎯
Focusing
View GitHub Profile
# --------------------------
# Imports
import json
import os
import pandas as pd
# -----Step 1
# Read the file
# Construct Filepath Session
dataFrame_session_cleaned = dataFrame_session.drop([
'temperature',
'pulse_avg',
'pulse_max',
'manual',
'edited',
'live_tracking_active',
'live_tracking_enabled',
'cheering_enabled',
'indoor',
pd.set_option('max_columns', None) # defining all columns to be displaied
print(dataFrame_session_cleaned.loc[0:])
# --------------------------
# Imports
import json
import os
import pandas as pd
# -----Step 1
# Read the file
# Construct Filepath Elevation-data
# -----Drop redundant columns
dataFrame_elevation_cleaned = dataFrame_elevation.drop(['version',
'source_type'], axis=1)
print('-----ObjectInfo-----')
print(dataFrame_elevation_cleaned.info())
# --------------------------
# Imports
import os
from gpx_converter import Converter
# -----Step 1
# Read the file
# Construct Filepath of gpx-tracking data
file_gpx = '2021-09-25_07-47-12-UTC_be9e18af-b133-4469-9058-45386372d3ce.gpx'
# --------------------------
# Imports
import matplotlib.pyplot as plt
print('-----Visualize all Trackingpoints-----')
plt.plot(dataFrame_gpx['longitude'], dataFrame_gpx['latitude'])
# ----------------------------
# Imports
import os
import gpxpy.gpx
import pandas as pd
import numpy as np
from gpx_converter import Converter
from geopy import distance
import matplotlib.pyplot as plt
import plotly.express as px
# ----------------------------
# Read, analyze and convert gpx-data
gpx_file = open(path_gpx, 'r') # read
gpx_data = gpxpy.parse(gpx_file)
gpx_file.close()
gpx_tracks = gpx_data.tracks
gpx_segments = gpx_data.tracks[0].segments
gpx_points = gpx_data.tracks[0].segments[0].points
# ----------------------------
print(gpx_df.info())