statistics module
mean, fmean, median, median_low, median_high, mode, multimode, pstdev, pvariance, stdev, variance,
quantiles and StatisticsError are available.
NormalDist,kde,kde_random,geometric_mean,harmonic_mean,median_grouped,covariance,correlationandlinear_regressionare not provided. They are missing from the module namespace, so they fail type checking as well as raisingAttributeErrorat runtime.DecimalandFractiondata are not supported bymean,variance,pvariance,stdevandpstdev. Monty has nofractionsmodule, and these functions raiseTypeError: can't convert type '<type>' to numerator/denominator, the error CPython gives for a type with noas_integer_ratio().median_low,median_highandmodework on any orderable (or hashable) value, as in CPython;medianandquantilesalso need data that can be added and divided.mode()andmultimode()of unhashable data raiseCounter’s message, which differs from CPython’s (see collections.md).StatisticsErrorreprs asstatistics.StatisticsError(...), as the other dotted exception classes do (see exceptions.md).quantiles()with anntoo large to allocate raisesMemoryErrorbefore computing any cut point, where CPython appends cut points until it runs out of memory.- The module has no
__all__, and its functions carry none of the attributes CPython’s Python functions have, as on every built-in module (see modules.md).