polars.arange#

polars.arange(low: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, high: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, step: int = 1, *, eager: Literal[False]) Expr[source]#
polars.arange(low: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, high: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, step: int = 1, *, eager: Literal[True]) Series
polars.arange(low: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, high: int | polars.internals.expr.expr.Expr | polars.internals.series.series.Series, step: int = 1, *, eager: bool = False) polars.internals.expr.expr.Expr | polars.internals.series.series.Series

Create a range expression.

This can be used in a select, with_column etc.

Be sure that the range size is equal to the DataFrame you are collecting.

Parameters:
low

Lower bound of range.

high

Upper bound of range.

step

Step size of the range.

eager

If eager evaluation is True, a Series is returned instead of an Expr.

Examples

>>> df.lazy().filter(pl.col("foo") < pl.arange(0, 100)).collect()