mteb/BrightProStackoverflowRetrieval huggingface dataset:
* [ 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.Expr.mean 

#  polars.Expr.mean  #

Expr.  mean  (  )  →  Self  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/expr/expr.py#L3224-L3241) #

    

Get mean value.

Examples

    
    
    >>> df = pl.DataFrame({"a": [-1, 0, 1]})
    >>> df.select(pl.col("a").mean())
    shape: (1, 1)
    ┌─────┐
    │ a   │
    │ --- │
    │ f64 │
    ╞═════╡
    │ 0.0 │
    └─────┘
    

[ __ previous  polars.Expr.max  ](polars.Expr.max.html "previous page") [ next
polars.Expr.median  __ ](polars.Expr.median.html "next page")

__ On this page

  * ` Expr.mean()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
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)
  * __
  * [ Categories ](../categories.html)
  * polars.Expr.... 

#  polars.Expr.cat.get_categories  #

Expr.cat.  get_categories  (  )  →  Expr  [ [source]
](https://github.com/pola-rs/polars/blob/main/py-
polars/polars/expr/categorical.py#L42-L63) #

    

Get the categories stored in this data type.

Examples

    
    
    >>> df = pl.Series(
    ...     "cats", ["foo", "bar", "foo", "foo", "ham"], dtype=pl.Categorical
    ... ).to_frame()
    >>> df.select(pl.col("cats").cat.get_categories())
    shape: (3, 1)
    ┌──────┐
    │ cats │
    │ ---  │
    │ str  │
    ╞══════╡
    │ foo  │
    │ bar  │
    │ ham  │
    └──────┘
    

[ __ previous  Categories  ](../categories.html "previous page") [ next
polars.Expr.cat.set_ordering  __ ](polars.Expr.cat.set_ordering.html "next
page")

__ On this page

  * ` Expr.cat.get_categories()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
* [ 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.Expr.first 

#  polars.Expr.first  #

Expr.  first  (  )  →  Self  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/expr/expr.py#L3439-L3456) #

    

Get the first value.

Examples

    
    
    >>> df = pl.DataFrame({"a": [1, 1, 2]})
    >>> df.select(pl.col("a").first())
    shape: (1, 1)
    ┌─────┐
    │ a   │
    │ --- │
    │ i64 │
    ╞═════╡
    │ 1   │
    └─────┘
    

[ __ previous  polars.Expr.count  ](polars.Expr.count.html "previous page") [
next  polars.Expr.implode  __ ](polars.Expr.implode.html "next page")

__ On this page

  * ` Expr.first()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
](../../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)
  * __
  * [ List ](../list.html)
  * polars.Serie... 

#  polars.Series.list.sum  #

Series.list.  sum  (  )  →  Series  [ [source]  ](https://github.com/pola-
rs/polars/blob/py-0.20.23/py-polars/polars/series/list.py#L172-L186) #

    

Sum all the arrays in the list.

Examples

    
    
    >>> s = pl.Series("values", [[1], [2, 3]])
    >>> s.list.sum()
    shape: (2,)
    Series: 'values' [i64]
    [
        1
        5
    ]
    

[ __ previous  polars.Series.list.std  ](polars.Series.list.std.html "previous
page") [ next  polars.Series.list.tail  __ ](polars.Series.list.tail.html
"next page")

__ On this page

  * ` Series.list.sum()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
/../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)
  * __
  * [ List ](../list.html)
  * polars.Serie... 

#  polars.Series.list.arg_max  #

Series.list.  arg_max  (  )  →  Series  [ [source]  ](https://github.com/pola-
rs/polars/blob/py-0.20.23/py-polars/polars/series/list.py#L614-L634) #

    

Retrieve the index of the maximum value in every sublist.

Returns  :

    

Series

    

Series of data type ` UInt32  ` or ` UInt64  ` (depending on compilation).

Examples

    
    
    >>> s = pl.Series("a", [[1, 2], [2, 1]])
    >>> s.list.arg_max()
    shape: (2,)
    Series: 'a' [u32]
    [
        1
        0
    ]
    

[ __ previous  polars.Series.list.drop_nulls
](polars.Series.list.drop_nulls.html "previous page") [ next
polars.Series.list.arg_min  __ ](polars.Series.list.arg_min.html "next page")

__ On this page

  * ` Series.list.arg_max()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
_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)
  * __
  * [ Array ](../array.html)
  * polars.Expr.... 

#  polars.Expr.arr.reverse  #

Expr.arr.  reverse  (  )  →  Expr  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/expr/array.py#L354-L378) #

    

Reverse the arrays in this column.

Examples

    
    
    >>> df = pl.DataFrame(
    ...     {
    ...         "a": [[3, 2, 1], [9, 1, 2]],
    ...     },
    ...     schema={"a": pl.Array(pl.Int64, 3)},
    ... )
    >>> df.with_columns(reverse=pl.col("a").arr.reverse())
    shape: (2, 2)
    ┌───────────────┬───────────────┐
    │ a             ┆ reverse       │
    │ ---           ┆ ---           │
    │ array[i64, 3] ┆ array[i64, 3] │
    ╞═══════════════╪═══════════════╡
    │ [3, 2, 1]     ┆ [1, 2, 3]     │
    │ [9, 1, 2]     ┆ [2, 1, 9]     │
    └───────────────┴───────────────┘
    

[ __ previous  polars.Expr.arr.sort  ](polars.Expr.arr.sort.html "previous
page") [ next  polars.Expr.arr.arg_min  __ ](polars.Expr.arr.arg_min.html
"next page")

__ On this page

  * ` Expr.arr.reverse()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
ame_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)
  * __
  * [ Temporal ](../temporal.html)
  * polars.Expr.... 

#  polars.Expr.dt.nanoseconds  #

Expr.dt.  nanoseconds  (  )  →  Expr  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/expr/datetime.py#L2453-L2461) #

    

Extract the total nanoseconds from a Duration type.

Deprecated since version 0.19.13:  Use [ ` total_nanoseconds()  `
](polars.Expr.dt.total_nanoseconds.html#polars.Expr.dt.total_nanoseconds
"polars.Expr.dt.total_nanoseconds") instead.

[ __ previous  polars.Expr.dt.nanosecond  ](polars.Expr.dt.nanosecond.html
"previous page") [ next  polars.Expr.dt.offset_by  __
](polars.Expr.dt.offset_by.html "next page")

__ On this page

  * ` Expr.dt.nanoseconds()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
ng.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)
  * __
  * [ Functions ](../functions.html)
  * polars.cumfold 

#  polars.cumfold  #

polars.  cumfold  (

     _ acc  :  IntoExpr  _ , 
     _ function  :  Callable  [  [  Series  ,  Series  ]  ,  Series  ]  _ , 
     _ exprs  :  Sequence  [  Expr  |  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") ]  |  Expr  _ , 
     _ *  _ , 
     _ include_init  :  [ bool  ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") =  False  _ , 
)  →  Expr  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-
polars/polars/functions/lazy.py#L2236-L2268) #

    

Cumulatively accumulate over multiple columns horizontally/ row wise with a
left fold.

Every cumulative result is added as a separate field in a Struct column.

Parameters  :

    

**acc**

    

Accumulator Expression. This is the value that will be initialized when the
fold starts. For a sum this could for instance be lit(0).

**function**

    

Function to apply over the accumulator and the value. Fn(acc, value) ->
new_value

**exprs**

    

Expressions to aggregate over. May also be a wildcard expression.

**include_init**

    

Include the initial accumulator state as struct field.

[ __ previous  polars.cum_sum_horizontal  ](polars.cum_sum_horizontal.html
"previous page") [ next  polars.cumreduce  __ ](polars.cumreduce.html "next
page")

__ On this page

  * ` cumfold()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.
rt_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)
  * __
  * [ String ](../string.html)
  * polars.Expr.... 

#  polars.Expr.str.strip  #

Expr.str.  strip  (  _ characters  :  [ 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  _ )  →  Expr  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-polars/polars/expr/string.py#L2461-L2476) # 
    

Remove leading and trailing characters.

Deprecated since version 0.19.3:  This method has been renamed to [ `
strip_chars()  `
](polars.Expr.str.strip_chars.html#polars.Expr.str.strip_chars
"polars.Expr.str.strip_chars") .

Parameters  :

    

**characters**

    

The set of characters to be removed. All combinations of this set of
characters will be stripped. If set to None (default), all whitespace is
removed instead.

[ __ previous  polars.Expr.str.starts_with  ](polars.Expr.str.starts_with.html
"previous page") [ next  polars.Expr.str.strip_chars  __
](polars.Expr.str.strip_chars.html "next page")

__ On this page

  * ` Expr.str.strip()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.