Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2020-06-12 17:53:43 +02:00
parent d9753a89fc
commit 8ab93bf13c

View File

@@ -2064,16 +2064,19 @@ def leaflet_chart(lat,lon,name=""):
def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}): def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
data = [] data = []
for id in workoutids: for id in workoutids:
w = Workout.objects.get(id=id) try:
rowdata = rdata(w.csvfilename) w = Workout.objects.get(id=id)
time = rowdata.df['TimeStamp (sec)'] rowdata = rdata(w.csvfilename)
df = pd.DataFrame({ time = rowdata.df['TimeStamp (sec)']
'workoutid':id, df = pd.DataFrame({
'lat':rowdata.df[' latitude'], 'workoutid':id,
'lon':rowdata.df[' longitude'], 'lat':rowdata.df[' latitude'],
'time':time-time[0], 'lon':rowdata.df[' longitude'],
}) 'time':time-time[0],
data.append(df) })
data.append(df)
except Workout.DoesNotExist:
pass
df = pd.concat(data,axis=0) df = pd.concat(data,axis=0)