MCPcopy Index your code
hub / github.com/python/cpython / _mean_stdev

Function _mean_stdev

Lib/statistics.py:1758–1768  ·  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

1756
1757
1758def _mean_stdev(data):
1759 """In one pass, compute the mean and sample standard deviation as floats."""
1760 T, ss, xbar, n = _ss(data)
1761 if n < 2:
1762 raise StatisticsError('stdev requires at least two data points')
1763 mss = ss / (n - 1)
1764 try:
1765 return float(xbar), _float_sqrt_of_frac(mss.numerator, mss.denominator)
1766 except AttributeError:
1767 # Handle Nans and Infs gracefully
1768 return float(xbar), float(xbar) / float(ss)
1769
1770
1771def _sqrtprod(x: float, y: float) -> float:

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…