Private
Public Access
1
0

improved filtering for Colin

This commit is contained in:
Sander Roosendaal
2020-03-18 07:49:38 +01:00
parent ff35c8062b
commit 3bcd14342a
2 changed files with 10 additions and 0 deletions

View File

@@ -483,6 +483,9 @@ def df_resample(datadf):
def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
ignoreadvanced=False):
# clean data remove zeros and negative values
before = len(datadf)
data_orig = datadf.copy()
# bring metrics which have negative values to positive domain
if len(datadf)==0:
@@ -706,6 +709,12 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
except:
pass
after = len(datadf.dropna())
ratio = float(after)/float(before)
if ratio < 0.001 or after < 2:
return data_orig
return datadf
def getstatsfields():