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

Function stdev

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

Return the square root of the sample variance. See ``variance`` for arguments and other details. >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75]) 1.0810874155219827

(data, xbar=None)

Source from the content-addressed store, hash-verified

905
906
907def stdev(data, xbar=None):
908 """Return the square root of the sample variance.
909
910 See ``variance`` for arguments and other details.
911
912 >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
913 1.0810874155219827
914
915 """
916 T, ss, c, n = _ss(data, xbar)
917 if n < 2:
918 raise StatisticsError('stdev requires at least two data points')
919 mss = ss / (n - 1)
920 if issubclass(T, Decimal):
921 return _decimal_sqrt_of_frac(mss.numerator, mss.denominator)
922 return _float_sqrt_of_frac(mss.numerator, mss.denominator)
923
924
925def pstdev(data, mu=None):

Callers 1

_test_generatorFunction · 0.90

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