MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / pstdev

Function pstdev

tools/python-3.11.9-amd64/Lib/statistics.py:925–940  ·  view source on GitHub ↗

Return the square root of the population variance. See ``pvariance`` for arguments and other details. >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) 0.986893273527251

(data, mu=None)

Source from the content-addressed store, hash-verified

923
924
925def pstdev(data, mu=None):
926 """Return the square root of the population variance.
927
928 See ``pvariance`` for arguments and other details.
929
930 >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
931 0.986893273527251
932
933 """
934 T, ss, c, n = _ss(data, mu)
935 if n < 1:
936 raise StatisticsError('pstdev requires at least one data point')
937 mss = ss / n
938 if issubclass(T, Decimal):
939 return _decimal_sqrt_of_frac(mss.numerator, mss.denominator)
940 return _float_sqrt_of_frac(mss.numerator, mss.denominator)
941
942
943def _mean_stdev(data):

Callers

nothing calls this directly

Calls 4

_ssFunction · 0.85
StatisticsErrorClass · 0.85
_decimal_sqrt_of_fracFunction · 0.85
_float_sqrt_of_fracFunction · 0.85

Tested by

no test coverage detected