commit | b6be5c58c1b96b828bae43a190e434a71088b94e | [log] [tgz] |
---|---|---|
author | koder aka kdanilov <kdanilov@mirantis.com> | Sat Oct 01 01:29:35 2016 +0300 |
committer | koder aka kdanilov <kdanilov@mirantis.com> | Sat Oct 01 01:29:35 2016 +0300 |
tree | e54973e933a474bbd72c7c3d4e76e25e3f77ad51 | |
parent | 765920a78f569e1461ad2899176f7ec16e581fd4 [diff] [blame] |
v2.0 started
diff --git a/wally/statistic.py b/wally/statistic.py index 06d525e..e2021e1 100644 --- a/wally/statistic.py +++ b/wally/statistic.py
@@ -16,8 +16,11 @@ def med_dev(vals): + if len(vals) == 1: + return vals[0], 0.0 + med = sum(vals) / len(vals) - dev = ((sum(abs(med - i) ** 2.0 for i in vals) / len(vals)) ** 0.5) + dev = ((sum(abs(med - i) ** 2.0 for i in vals) / (len(vals) - 1)) ** 0.5) return med, dev