aboutsummaryrefslogtreecommitdiffstats
path: root/stats.py
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-18 03:04:46 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-18 03:04:46 -0500
commit89e5192f1ee83ebb3a7bd87aefc5d23ce4ab2c2b (patch)
tree4cdc41b4750719c13eb8f6534fce879c577dbd88 /stats.py
parente37ed32d9b861581942ec5cfb8948f0602c0a481 (diff)
Support for compacting binary data
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])