daft.functions.list_append#
list_append #
list_append(list_expr: Expression, other: Expression) -> Expression
Appends a value to each list in the column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_expr | List Expression | expression to append to | required |
other | Expression | A value or column of values to append to each list | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | List Expression | an expression with the updated lists |
Examples:
1 2 3 4 5 | |
╭─────────────┬───────┬───────────────╮
│ a ┆ b ┆ combined │
│ --- ┆ --- ┆ --- │
│ List[Int64] ┆ Int64 ┆ List[Int64] │
╞═════════════╪═══════╪═══════════════╡
│ [1, 2] ┆ 10 ┆ [1, 2, 10] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ [3, 4, 5] ┆ 11 ┆ [3, 4, 5, 11] │
╰─────────────┴───────┴───────────────╯
(Showing first 2 of 2 rows) Source code in daft/functions/list.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | |