赞
踩
python列表查找值
Hi Folks! In this article, we will have a look at the various ways to find the average of a list in a Python List.
嗨伙计! 在本文中,我们将介绍在Python List中查找列表平均值的各种方法 。
In general, an average is a value that represents a whole set of data items or elements.
通常,平均值是代表整个数据项或元素集的值。
Formula: Average = summation of numbers/total count.
公式:平均值=数字总和/总计数。
Either of the following techniques can be used to calculate the average/mean of a list in Python:
以下任何一种技术均可用于计算Python中列表的平均值/均值:
Python 3 has statistics module
which contains an in-built function to calculate the mean or average of numbers. The statistics.mean() function
is used to calculate the mean/average of input values or data set.
Python 3具有statistics module
,该statistics module
包含一个内置函数来计算数字的均值或平均值。 statistics.mean() function
用于计算输入值或数据集的平均值/平均值 。
The mean() function accepts the list, tuple or data-set containing numeric values as a parameter and returns the average of the data-items.
mean()函数接受包含数值的列表,元组或数据集作为参数,并返回
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。