Statistics Functions
statistics.pvariance()
Compute the mean squared deviation using population size as denominator. Requires at least one observation; optional mu supplies the center.
Formal Syntax & Structure
python syntaxpython
statistics.pvariance(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
number
Numeric result; concrete type depends on inputs.
Working Example
Example Snippetpython
import statisticsprint(statistics.pvariance([2, 6]))