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

Function _mean_stdev

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

In one pass, compute the mean and sample standard deviation as floats.

(data)

Source from the content-addressed store, hash-verified

941
942
943def _mean_stdev(data):
944 """In one pass, compute the mean and sample standard deviation as floats."""
945 T, ss, xbar, n = _ss(data)
946 if n < 2:
947 raise StatisticsError('stdev requires at least two data points')
948 mss = ss / (n - 1)
949 try:
950 return float(xbar), _float_sqrt_of_frac(mss.numerator, mss.denominator)
951 except AttributeError:
952 # Handle Nans and Infs gracefully
953 return float(xbar), float(xbar) / float(ss)
954
955
956# === Statistics for relations between two inputs ===

Callers 1

from_samplesMethod · 0.85

Calls 3

_ssFunction · 0.85
StatisticsErrorClass · 0.85
_float_sqrt_of_fracFunction · 0.85

Tested by

no test coverage detected