def Median(t): """中位数""" arr = sorted(t) idx = (len(arr) - 1) / 2 if type(idx) is int: return arr[idx] if type(idx) is float: return Mean(arr[int(math.floor(idx)):int(math.ceil(idx)) + 1])
中位数定义及示例,布布扣,bubuko.com
中位数定义及示例
原文:http://www.cnblogs.com/data80386/p/3842225.html