---
title: var_pop
description: "var\\_pop function in PySpark: Returns the population variance of the values in a group."
canonical_url: https://docs.databricks.com/aws/en/pyspark/reference/functions/var_pop
---

# var\_pop

Returns the population variance of the values in a group.

## Syntax

```python
from pyspark.sql import functions as sf

sf.var_pop(col)
```

## Parameters

| Parameter | Type                                | Description                  |
| --------- | ----------------------------------- | ---------------------------- |
| `col`     | `pyspark.sql.Column` or column name | Target column to compute on. |

## Returns

`pyspark.sql.Column`: variance of given column.

## Examples

```python
from pyspark.sql import functions as sf
df = spark.range(6)
df.select(sf.var_pop(df.id)).show()
```

```Output
+------------------+
|       var_pop(id)|
+------------------+
|2.9166666666666...|
+------------------+
```
