median will now return a float with both even and odd number of values

This commit is contained in:
Jeremy Carbaugh 2011-09-14 13:22:52 -04:00
parent b3b491d927
commit 7e7893109a

View File

@ -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