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

阿里云2000元红包!本站用户参与享受九折优惠!

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 

https://www.jianshu.com/p/d2941cf18bab

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论