Private
Public Access
1
0

hotfix OTW CP chart

This commit is contained in:
Sander Roosendaal
2018-04-16 07:45:24 +02:00
parent 8636e7032e
commit 496c1efd5b
4 changed files with 10 additions and 4 deletions

View File

@@ -719,7 +719,13 @@ def fetchcp(rower,theworkouts,table='cpdata'):
return pd.Series([]),pd.Series([]),avgpower2
dfgrouped = df.groupby(['workoutid'])
avgpower2 = dict(dfgrouped.mean()['power'].astype(int))
try:
avgpower2 = dict(dfgrouped.mean()['power'].astype(int))
except KeyError:
avgpower2 = {}
for id in theids:
avgpower2[id] = 0
return pd.Series([]),pd.Series([]),avgpower2
cpdf = getcpdata_sql(rower.id,table=table)