import numpy as np
#A公司
a1,b1=np.loadtxt('excel/excel2.csv',encoding='utf-8',delimiter=',',usecols=(1,2),unpack=True)
list1=[]
#外层循环遍历薪资种类
for i in range(len(a1)):
#内层循环遍历该薪资多对应的人数
for j in range(int(b1[i])):
list1.append(a1[i])
ar1=np.array(list1)
#中位数
s1=np.median(ar1)
print(s1)
#带权平均值
w1=np.average(a1,weights=b1)
print(w1)