improved filtering for Colin
This commit is contained in:
@@ -483,6 +483,9 @@ def df_resample(datadf):
|
|||||||
def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
||||||
ignoreadvanced=False):
|
ignoreadvanced=False):
|
||||||
# clean data remove zeros and negative values
|
# clean data remove zeros and negative values
|
||||||
|
before = len(datadf)
|
||||||
|
|
||||||
|
data_orig = datadf.copy()
|
||||||
|
|
||||||
# bring metrics which have negative values to positive domain
|
# bring metrics which have negative values to positive domain
|
||||||
if len(datadf)==0:
|
if len(datadf)==0:
|
||||||
@@ -706,6 +709,12 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
after = len(datadf.dropna())
|
||||||
|
ratio = float(after)/float(before)
|
||||||
|
|
||||||
|
if ratio < 0.001 or after < 2:
|
||||||
|
return data_orig
|
||||||
|
|
||||||
return datadf
|
return datadf
|
||||||
|
|
||||||
def getstatsfields():
|
def getstatsfields():
|
||||||
|
|||||||
@@ -3715,6 +3715,7 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
|
|
||||||
|
|
||||||
if len(rowdata)<2:
|
if len(rowdata)<2:
|
||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
||||||
workstrokesonly=False)
|
workstrokesonly=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user