[ 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)
  * __
  * [ Columns / names ](../columns.html)
  * polars.Expr.exclude 

#  polars.Expr.exclude  #

Expr.  exclude  (

     _ columns  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  PolarsDataType  |  Collection  [  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") ]  |  Collection  [  PolarsDataType  ]  _ , 
     _ *  more_columns  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  PolarsDataType  _ , 
)  →  Self  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-
polars/polars/expr/expr.py#L899-L1009) #

    

Exclude columns from a multi-column expression.

Only works after a wildcard or regex column selection, and you cannot provide
both string column names _and_ dtypes (you may prefer to use selectors
instead).

Parameters  :

    

**columns**

    

The name or datatype of the column(s) to exclude. Accepts regular expression
input. Regular expressions should start with ` ^  ` and end with ` $  ` .

***more_columns**

    

Additional names or datatypes of columns to exclude, specified as positional
arguments.

Examples

    
    
    >>> df = pl.DataFrame(
    ...     {
    ...         "aa": [1, 2, 3],
    ...         "ba": ["a", "b", None],
    ...         "cc": [None, 2.5, 1.5],
    ...     }
    ... )
    >>> df
    shape: (3, 3)
    ┌─────┬──────┬──────┐
    │ aa  ┆ ba   ┆ cc   │
    │ --- ┆ ---  ┆ ---  │
    │ i64 ┆ str  ┆ f64  │
    ╞═════╪══════╪══════╡
    │ 1   ┆ a    ┆ null │
    │ 2   ┆ b    ┆ 2.5  │
    │ 3   ┆ null ┆ 1.5  │
    └─────┴──────┴──────┘
    

Exclude by column name(s):

    
    
    >>> df.select(pl.all().exclude("ba"))
    shape: (3, 2)
    ┌─────┬──────┐
    │ aa  ┆ cc   │
    │ --- ┆ ---  │
    │ i64 ┆ f64  │
    ╞═════╪══════╡
    │ 1   ┆ null │
    │ 2   ┆ 2.5  │
    │ 3   ┆ 1.5  │
    └─────┴──────┘
    

Exclude by regex, e.g. removing all columns whose names end with the letter
“a”:

    
    
    >>> df.select(pl.all().exclude("^.*a$"))
    shape: (3, 1)
    ┌──────┐
    │ cc   │
    │ ---  │
    │ f64  │
    ╞══════╡
    │ null │
    │ 2.5  │
    │ 1.5  │
    └──────┘
    

Exclude by dtype(s), e.g. removing all columns of type Int64 or Float64:

    
    
    >>> df.select(pl.all().exclude([pl.Int64, pl.Float64]))
    shape: (3, 1)
    ┌──────┐
    │ ba   │
    │ ---  │
    │ str  │
    ╞══════╡
    │ a    │
    │ b    │
    │ null │
    └──────┘
    

[ __ previous  polars.Expr.alias  ](polars.Expr.alias.html "previo