Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 20, 2024
1 parent 5b64c4c commit 15a9149
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions py-polars/polars/functions/range/int_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def int_range(
Examples
--------
>>> pl.int_range(0, 3, eager=True).alias("int")
>>> pl.int_range(0, 3, eager=True)
shape: (3,)
Series: 'int' [i64]
Series: 'literal' [i64]
[
0
1
Expand All @@ -189,9 +189,9 @@ def int_range(
`end` can be omitted for a shorter syntax.
>>> pl.int_range(3, eager=True).alias("int")
>>> pl.int_range(3, eager=True)
shape: (3,)
Series: 'int' [i64]
Series: 'literal' [i64]
[
0
1
Expand Down Expand Up @@ -320,18 +320,15 @@ def int_ranges(
`end` can be omitted for a shorter syntax.
>>> df = pl.DataFrame({"end": [0, 1, 2, 3]})
>>> df.with_columns(int_range=pl.int_ranges("end"))
shape: (4, 2)
>>> df.select("end", int_range=pl.int_ranges("end"))
shape: (2, 2)
┌─────┬───────────┐
│ end ┆ int_range │
│ --- ┆ --- │
│ i64 ┆ list[i64] │
╞═════╪═══════════╡
│ 0 ┆ [] │
│ 1 ┆ [0] │
│ 2 ┆ [0, 1] │
│ 3 ┆ [0, 1, 2] │
│ 2 ┆ [0, 1] │
└─────┴───────────┘
"""
if end is None:
Expand Down

0 comments on commit 15a9149

Please sign in to comment.