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)
  * __
  * [ Computation ](../computation.html)
  * polars.Expr.... 

#  polars.Expr.rolling_mean  #

Expr.  rolling_mean  (

     _ window_size  :  [ int  ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)") |  timedelta  |  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") _ , 
     _ weights  :  [ list  ](https://docs.python.org/3/library/stdtypes.html#list "\(in Python v3.12\)") [  [ float  ](https://docs.python.org/3/library/functions.html#float "\(in Python v3.12\)") ]  |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ min_periods  :  [ int  ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)") |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ *  _ , 
     _ center  :  [ bool  ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") =  False  _ , 
     _ by  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ closed  :  ClosedInterval  |  [ None  ](https://docs.python.org/3/library/constants.html#None "\(in Python v3.12\)") =  None  _ , 
     _ warn_if_unsorted  :  [ bool  ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") =  True  _ , 
)  →  Self  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-
polars/polars/expr/expr.py#L6512-L6757) #

    

Apply a rolling mean (moving mean) over the values in this array.

Warning

This functionality is considered **unstable** . It may be changed at any point
without it being considered a breaking change.

A window of length ` window_size  ` will traverse the array. The values that
fill this window will (optionally) be multiplied with the weights given by the
` weight  ` vector. The resulting values will be aggregated to their mean.

If ` by  ` has not been specified (the default), the window at a given row
will include the row itself, and the ` window_size  -  1  ` elements before
it.

If you pass a ` by  ` column ` <t_0,  t_1,  ...,  t_n> ` , then `
closed="right"  ` (the default) means the windows will be:

>   * (t_0 - window_size, t_0]
>
>   * (t_1 - window_size, t_1]
>
>   * …
>
>   * (t_n - window_size, t_n]
>
>

Parameters  :

    

**window_size**

    

The length of the window. Can be a fixed integer siz