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

NameTypeDescription
dataiterable of numbersObservations used by the statistic.
munumber or NoneKnown 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]))
Python Reference