Private
Public Access
1
0

fixing power cleaning

This commit is contained in:
Sander Roosendaal
2020-12-16 08:39:58 +01:00
parent ed6e4ff8fc
commit 1092101bfe
2 changed files with 8 additions and 0 deletions

View File

@@ -683,6 +683,12 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
except (KeyError,TypeError):
pass
try:
mask = datadf['power'] > 5000
datadf.mask(mask,inplace=True)
except (KeyError,TypeError):
pass
try:
mask = datadf['spm'] > 120
datadf.mask(mask,inplace=True)

View File

@@ -3430,11 +3430,13 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
# prepare data frame
datadf,row = dataprep.getrowdata_db(id=encoder.decode_hex(id))
print(datadf.power.mean(),'aap')
datadf = dataprep.clean_df_stats(datadf,workstrokesonly=workstrokesonly,
ignoreadvanced=False)
print(datadf.power.mean(),'noot')
if datadf.empty:
datadf,row = dataprep.getrowdata_db(id=encoder.decode_hex(id))