Statistics Functions
statistics.stdev()
Compute sample standard deviation using the sample variance with denominator n-1. At least two observations are required.
Formal Syntax & Structure
python syntaxpython
statistics.stdev(data, xbar=None)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | iterable of numbers | Observations used by the statistic. |
| xbar | number or None | Known sample mean, or None to calculate it. |
Return Value
float or Decimal
Standard deviation; Decimal for Decimal data, float otherwise.
Working Example
Example Snippetpython
import statisticsprint(statistics.stdev([2, 4, 6]))