: .
Python四分位和中位数计算代码
Python四分位和中位数计算代码--我超怕的
IfJfJ: .
Python四分位和中位数计算代码
Python四分位和中位数计算代码--我超怕的
IfJfJXJXJXJfJfJXJXJXJfJf
itititititititititititit
#Name:计算四分位和中位数
#Author:我超怕的
#Date:2021-05-21
j«jfjXjXjfjfjfjXjfjfjf
ititititititititititit
#接受、处理数据numbers=[1,2,3,4,5,6,7]()#print(numbers)
#总个数total=len(numbers)
#四分位位置
local=[]
foriinrange(5):
n=(i*(total-1)/4)+1
(n)
#print(local)
#四分位计算
#整数部分numbersInteger=[]foriinlocal:
(int(i))
#整数结果numbersIntergerResults=[]foriinnumbersInteger:
#print(i-1)
(numbers[i-1])
#print(numbersIntergerResults)
#整数四分位下?个数
numbersIntergerNextResults=[]foriinnumbersInteger:
ifi>=total:
i=total-(numbers[i])
#差值numbersIntergerSubResults=[]foriinrange(5):
(numbersIntergerNextResults[i]-numbersIntergerResults[i])
#?数部分numbersFloat=[]foriinlocal:
Python四分位和中位数计算代码 来自淘豆网m.daumloan.com转载请标明出处.