aboutsummaryrefslogtreecommitdiffstats
path: root/stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'stats.py')
-rw-r--r--stats.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/stats.py b/stats.py
index f6c4401..cede673 100644
--- a/stats.py
+++ b/stats.py
@@ -13,6 +13,12 @@ def iqr(vect):
13def cutoff_max(vect, percentile=99): 13def cutoff_max(vect, percentile=99):
14 return s.scoreatpercentile(vect, percentile) 14 return s.scoreatpercentile(vect, percentile)
15 15
16def iqr_cutoff(vect, extend):
17 (spread, low, high) = iqr(vect)
18 min_val = low - extend * spread
19 max_val = high + extend * spread
20 return min_val, max_val
21
16def iqr_is_not_outlier(table, col=1, extend=1.5): 22def iqr_is_not_outlier(table, col=1, extend=1.5):
17 "create a filter function that flags outliers" 23 "create a filter function that flags outliers"
18 (spread, low, high) = iqr(table[:,col]) 24 (spread, low, high) = iqr(table[:,col])