import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path="D:\\统计学学习小组\\three_test1.csv"
data = pd.read_csv(path, encoding = "UTF-8",engine='python').iloc[0:20,0]
# 算数平均数
print("算数平均数:"+str(data.mean()))
# 几何平均数
s=1
s1=0
for i in data:
s=i*s
s1=s1+1
print("几何平均数"+ str(s**(1/s1)))
# 众数
print("众数为: %d," %data.mode().iloc[0])
# 中位数
print("中位数:%f" %data.median())
# 方差
print("方差: %f" %data.var())
# 标准差
print("标准差: %f" %data.std())
# 极差
print("极差: %d" %(data.max() - data.min()))
# 离散系数
print("离散系数: %f" %(data.std()/data.mean()))
# 偏度
from scipy import stats
print("偏度: %f" %stats.skew(data))
# 峰度
print("峰度: %f" %stats.kurtosis(data))``