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.
Optional
end: number | pl.ExprEnd of the range (exclusive). If set to None
(default), the value of start
is used and start
is set to 0
.
Optional
step: number | pl.ExprStep size of the range.
Optional
dtype: DataTypeData type of the range.
Optional
eager: 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.
Start of the range (inclusive). Defaults to 0.
Optional
end: number | pl.ExprEnd of the range (exclusive). If set to None
(default), the value of start
is used and start
is set to 0
.
Optional
step: number | pl.ExprStep size of the range.
Optional
dtype: DTData type of the range.
Optional
eager: 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_column
etc. Be sure that the range size is equal to the DataFrame you are collecting.