daft.functions.seq#
seq #
seq(n: Expression) -> Expression
Generates a list of sequential integers [0, 1, 2, ..., n-1] for each row.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n | Expression | An integer expression specifying the length of the sequence. | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | List[UInt64] Expression | An expression with lists of sequential integers. |
Examples:
1 2 3 4 | |
╭───────┬─────────────────╮
│ n ┆ indices │
│ --- ┆ --- │
│ Int64 ┆ List[UInt64] │
╞═══════╪═════════════════╡
│ 3 ┆ [0, 1, 2] │
├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 5 ┆ [0, 1, 2, 3, 4] │
├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 0 ┆ [] │
╰───────┴─────────────────╯
(Showing first 3 of 3 rows) Source code in daft/functions/list.py
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | |