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)
| 923 | |
| 924 | |
| 925 | def 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 | |
| 943 | def _mean_stdev(data): |
nothing calls this directly
no test coverage detected