Private
Public Access
1
0

fixing the fix

This commit is contained in:
Sander Roosendaal
2020-12-28 19:49:38 +01:00
parent c497e17f1f
commit 2e48fba67a

View File

@@ -546,9 +546,10 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
ignoreadvanced=False):
# clean data remove zeros and negative values
try:
workoutids = datadf['workoutid'].unqiue()
except (KeyError,AttributeError):
workoutids = datadf['workoutid'].unique()
except KeyError:
datadf['workoutid'] = 0
before = {}
@@ -802,9 +803,9 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
after = {}
for workoutid in data_orig['workoutid'].unique():
after[workoutid] = len(datadf[datadf['workoutid']==workoutid].dropna())
ratio = float(after[workoutid])/float(before[workoutid])
if ratio < 0.01 or after < 2:
return data_orig