Start of the range (inclusive). Defaults to 0.
Optionalend: number | pl.ExprEnd of the range (exclusive). If set to None (default), the value of start is used and start is set to 0.
Optionalstep: number | pl.ExprStep size of the range.
Optionaldtype: DataType<any>Data type of the range.
Optionaleager: falseEvaluate immediately and return a Series. If set to False (default), return an expression instead.
Expr or Series Column of integer data type dtype.
> df.lazy()
> .filter(pl.col("foo").lt(pl.intRange(0, 100)))
> .collect()
Generate an index column by using intRange in conjunction with :func:len.
df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
df.select(
... pl.intRange(pl.len()).alias("index"),
... pl.all(),
... )
shape: (3, 3)
┌───────┬─────┬─────┐
│ index ┆ a ┆ b │
│ --- ┆ --- ┆ --- │
│ u32 ┆ i64 ┆ i64 │
╞═══════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 │
│ 1 ┆ 3 ┆ 4 │
│ 2 ┆ 5 ┆ 6 │
└───────┴─────┴─────┘
Generate a range of integers.
This can be used in a select, with_column etc.
Be sure that the range size is equal to the DataFrame you are collecting.
Expr or Series Column of integer data type dtype.
> df.lazy()
> .filter(pl.col("foo").lt(pl.intRange(0, 100)))
> .collect()
Generate an index column by using intRange in conjunction with :func:len.
df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
df.select(
... pl.intRange(pl.len()).alias("index"),
... pl.all(),
... )
shape: (3, 3)
┌───────┬─────┬─────┐
│ index ┆ a ┆ b │
│ --- ┆ --- ┆ --- │
│ u32 ┆ i64 ┆ i64 │
╞═══════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 │
│ 1 ┆ 3 ┆ 4 │
│ 2 ┆ 5 ┆ 6 │
└───────┴─────┴─────┘
Generate a range of integers.
This can be used in a select, with_column etc.
Be sure that the range size is equal to the DataFrame you are collecting.
Expr or Series Column of integer data type dtype.
> df.lazy()
> .filter(pl.col("foo").lt(pl.intRange(0, 100)))
> .collect()
Generate an index column by using intRange in conjunction with :func:len.
df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
df.select(
... pl.intRange(pl.len()).alias("index"),
... pl.all(),
... )
shape: (3, 3)
┌───────┬─────┬─────┐
│ index ┆ a ┆ b │
│ --- ┆ --- ┆ --- │
│ u32 ┆ i64 ┆ i64 │
╞═══════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 │
│ 1 ┆ 3 ┆ 4 │
│ 2 ┆ 5 ┆ 6 │
└───────┴─────┴─────┘
Generate a range of integers.
This can be used in a select, with_column etc.
Be sure that the range size is equal to the DataFrame you are collecting.
Expr or Series Column of integer data type dtype.
> df.lazy()
> .filter(pl.col("foo").lt(pl.intRange(0, 100)))
> .collect()
Generate an index column by using intRange in conjunction with :func:len.
df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
df.select(
... pl.intRange(pl.len()).alias("index"),
... pl.all(),
... )
shape: (3, 3)
┌───────┬─────┬─────┐
│ index ┆ a ┆ b │
│ --- ┆ --- ┆ --- │
│ u32 ┆ i64 ┆ i64 │
╞═══════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 │
│ 1 ┆ 3 ┆ 4 │
│ 2 ┆ 5 ┆ 6 │
└───────┴─────┴─────┘
Generate a range of integers.
This can be used in a select, with_column etc.
Be sure that the range size is equal to the DataFrame you are collecting.
Start of the range (inclusive). Defaults to 0.
Optionalend: number | pl.ExprEnd of the range (exclusive). If set to None (default), the value of start is used and start is set to 0.
Optionalstep: number | pl.ExprStep size of the range.
Optionaldtype: DTData type of the range.
Optionaleager: trueEvaluate immediately and return a Series. If set to False (default), return an expression instead.
Expr or Series Column of integer data type dtype.
> df.lazy()
> .filter(pl.col("foo").lt(pl.intRange(0, 100)))
> .collect()
Generate an index column by using intRange in conjunction with :func:len.
df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
df.select(
... pl.intRange(pl.len()).alias("index"),
... pl.all(),
... )
shape: (3, 3)
┌───────┬─────┬─────┐
│ index ┆ a ┆ b │
│ --- ┆ --- ┆ --- │
│ u32 ┆ i64 ┆ i64 │
╞═══════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 │
│ 1 ┆ 3 ┆ 4 │
│ 2 ┆ 5 ┆ 6 │
└───────┴─────┴─────┘
Generate a range of integers.
This can be used in a
select,with_columnetc. Be sure that the range size is equal to the DataFrame you are collecting.