新聞中心
Python statistics 模塊
Python statistics 是標準庫中的一個模塊,模塊提供了許多基本統(tǒng)計計算的函數(shù)。

statistics 模塊是在 Python 3.4 版本中新增加的,可以幫助我們分析和計算數(shù)據(jù)集的統(tǒng)計特征。
要使用 statistics 函數(shù)必須先導(dǎo)入:
import statistics
查看 statistics 模塊中的內(nèi)容:
>>>
import statistics
>>>
dir
(statistics
)
[
'Counter'
,
'Decimal'
,
'Fraction'
,
'NormalDist'
,
'StatisticsError'
,
'__all__'
,
'__builtins__'
,
'__cached__'
,
'__doc__'
,
'__file__'
,
'__loader__'
,
'__name__'
,
'__package__'
,
'__spec__'
,
'_coerce'
,
'_convert'
,
'_exact_ratio'
,
'_fail_neg'
,
'_find_lteq'
,
'_find_rteq'
,
'_isfinite'
,
'_normal_dist_inv_cdf'
,
'_ss'
,
'_sum'
,
'bisect_left'
,
'bisect_right'
,
'erf'
,
'exp'
,
'fabs'
,
'fmean'
,
'fsum'
,
'geometric_mean'
,
'groupby'
,
'harmonic_mean'
,
'hypot'
,
'itemgetter'
,
'log'
,
'math'
,
'mean'
,
'median'
,
'median_grouped'
,
'median_high'
,
'median_low'
,
'mode'
,
'multimode'
,
'numbers'
,
'pstdev'
,
'pvariance'
,
'quantiles'
,
'random'
,
'sqrt'
,
'stdev'
,
'tau'
,
'variance'
]
math 模塊方法
| 方法 | 描述 |
|---|---|
| 計算給定數(shù)據(jù)集的調(diào)和平均值。 | |
| 計算數(shù)據(jù)集的平均值 | |
| 計算數(shù)據(jù)集的中位數(shù) | |
| 計算給定分組數(shù)據(jù)集的分組中位數(shù) | |
| 計算給定數(shù)據(jù)集的高位中位數(shù) | |
| 計算給定數(shù)據(jù)集的低位中位數(shù)。 | |
| 算數(shù)據(jù)集的眾數(shù)(出現(xiàn)頻率最高的值) | |
| 計算給定數(shù)據(jù)集的樣本標準偏差 | |
| 計算數(shù)據(jù)集的標準差 | |
| 計算給定數(shù)據(jù)集的樣本方差 | |
| 計算數(shù)據(jù)集的方差 | |
| 計算數(shù)據(jù)集的分位數(shù),可指定分位數(shù)的數(shù)量(默認為四分位數(shù)) |
文章標題:Pythonstatistics模塊
新聞來源:http://m.fisionsoft.com.cn/article/cddheps.html


咨詢
建站咨詢
