Statistics Functions
statistics.pstdev()
Compute population standard deviation, the square root of population variance. Supply mu only if it is the known population mean.
Formal Syntax & Structure
python syntaxpython
statistics.pstdev(data, mu=None)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | iterable of numbers | Observations used by the statistic. |
| mu | number or None | Known population 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.pstdev([2, 6]))