From 7e7893109a6e71524e0f67cc53ee17f0172aaf94 Mon Sep 17 00:00:00 2001 From: Jeremy Carbaugh Date: Wed, 14 Sep 2011 13:22:52 -0400 Subject: [PATCH] median will now return a float with both even and odd number of values --- saucebrush/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saucebrush/stats.py b/saucebrush/stats.py index b726035..cc5ba83 100644 --- a/saucebrush/stats.py +++ b/saucebrush/stats.py @@ -27,7 +27,7 @@ def _median(values): if count % 2 == 1: # odd number of items, return middle value - return values[count / 2] + return float(values[count / 2]) else: # even number of items, return average of middle two items mid = count / 2