polars.select#

polars.select(exprs: IntoExpr | Iterable[IntoExpr] | None = None, *more_exprs: IntoExpr, **named_exprs: IntoExpr) DataFrame[source]#

Run polars expressions without a context.

This is syntactic sugar for running df.select on an empty DataFrame.

Parameters:
exprs

Expression or expressions to run.

*more_exprs

Additional expressions to run, specified as positional arguments.

**named_exprs

Additional expressions to run, specified as keyword arguments. The expressions will be renamed to the keyword used.

Returns:
DataFrame

Examples

>>> foo = pl.Series("foo", [1, 2, 3])
>>> bar = pl.Series("bar", [3, 2, 1])
>>> pl.select(pl.min([foo, bar]))
shape: (3, 1)
┌─────┐
│ min │
│ --- │
│ i64 │
╞═════╡
│ 1   │
│ 2   │
│ 1   │
└─────┘