./api/polars.exceptions.DuplicateError.html)
    * [ polars.exceptions.InvalidOperationError ](../../api/polars.exceptions.InvalidOperationError.html)
    * [ polars.exceptions.NoDataError ](../../api/polars.exceptions.NoDataError.html)
    * [ polars.exceptions.NoRowsReturnedError ](../../api/polars.exceptions.NoRowsReturnedError.html)
    * [ polars.exceptions.PolarsError ](../../api/polars.exceptions.PolarsError.html)
    * [ polars.exceptions.PolarsPanicError ](../../api/polars.exceptions.PolarsPanicError.html)
    * [ polars.exceptions.RowsError ](../../api/polars.exceptions.RowsError.html)
    * [ polars.exceptions.SchemaError ](../../api/polars.exceptions.SchemaError.html)
    * [ polars.exceptions.SchemaFieldNotFoundError ](../../api/polars.exceptions.SchemaFieldNotFoundError.html)
    * [ polars.exceptions.ShapeError ](../../api/polars.exceptions.ShapeError.html)
    * [ polars.exceptions.StructFieldNotFoundError ](../../api/polars.exceptions.StructFieldNotFoundError.html)
    * [ polars.exceptions.TooManyRowsReturnedError ](../../api/polars.exceptions.TooManyRowsReturnedError.html)

  * [ Testing ](../../testing.html) __
    * [ polars.testing.assert_frame_equal ](../../api/polars.testing.assert_frame_equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ Aggregation ](../aggregation.html)
  * polars.LazyFrame.var 

#  polars.LazyFrame.var  #

LazyFrame.  var  (  _ ddof  :  [ int
](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)")
=  1  _ )  →  Self  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/lazyframe/frame.py#L5107-L5145) #

    

Aggregate the columns in the LazyFrame to their variance value.

Parameters  :

    

**ddof**

    

“Delta Degrees of Freedom”: the divisor used in the calculation is N - ddof,
where N represents the number of elements. By default ddof is 1.

Examples

    
    
    >>> lf = pl.LazyFrame(
    ...     {
    ...         "a": [1, 2, 3, 4],
    ...         "b": [1, 2, 1, 1],
    ...     }
    ... )
    >>> lf.var().collect()
    shape: (1, 2)
    ┌──────────┬──────┐
    │ a        ┆ b    │
    │ ---      ┆ ---  │
    │ f64      ┆ f64  │
    ╞══════════╪══════╡
    │ 1.666667 ┆ 0.25 │
    └──────────┴──────┘
    >>> lf.var(ddof=0).collect()
    shape: (1, 2)
    ┌──────┬────────┐
    │ a    ┆ b      │
    │ ---  ┆ ---    │
    │ f64  ┆ f64    │
    ╞══════╪════════╡
    │ 1.25 ┆ 0.1875 │
    └──────┴────────┘
    

[ __ previous  polars.LazyFrame.sum  ](polars.LazyFrame.sum.html "previous
page") [ next  Attributes  __