我有两个清单:
td { padding: 0; }
[0.7181,7.3,561257621.7,0.12122,9.8]
如何计算第二表中我所拥有的指数的平均值?
答案 0 :(得分:2)
我会用:
>>> elements = [0.7181, 7.3, 561257621.7, 0.12122, 9.8]
>>> indices = [0, 2]
>>> sum([elements[i] for i in indices])/len(indices)
280628811.20905