多人投票,对票数进行统计,同时支持去掉最高和最低

2019-11-30  本文已影响0人  求索_700e

import numpy as np

fangzi=np.array([2,1,3,1,6,1,1,1])

tianhong=np.array([1,9,5,3,8,9,10,3])

kekong=np.array([3,4,2,2,10,3,5,9])

duxu=np.array([4,3,1,5,7,6,3,5])

xiaon=np.array([5,6,8,6,4,7,6,8])

dongy=np.array([6,2,4,4,5,5,2,4])

shij=np.array([7,5,13,7,2,4,4,10])

wangx=np.array([8,8,10,13,9,11,13,13])

zhangf=np.array([9,10,6,8,13,2,9,2])

suh=np.array([10,12,7,11,3,10,8,6])

dengs=np.array([11,11,9,10,12,8,11,12])

zhangc=np.array([12,7,12,9,11,12,12,7])

xiaom=np.array([13,13,11,12,1,13,7,11])

table=[fangzifan, tianhongliang,kekongde,duxuan,xiaonengqi,dongyuanfa,shijinjin,wangxiaopeng,zhangfajun,suhuashan,dengshoucheng,zhangcunji,xiaomin]

name=["fangzi", "tianh","kek","dux","xiaon",

      "dongy","shij","wangx","zhangf","suh","dengs","zhangc","xiaom"]

k=0

for i in table:

    s=np.sort(i)

    #print(name[k]+" = ", np.mean(s[1:-1]))   

    #k+=1 

上一篇下一篇

猜你喜欢

热点阅读