daft.functions.list_map#
list_map #
list_map(list_expr: Expression, mapper: Expression) -> Expression
Evaluates an expression on all elements in the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_expr | List Expression | expression to map over. | required |
mapper | Expression | Expression to run. You can select the element with | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | List Expression | an expression representing the mapped list. |
Examples:
1 2 3 4 | |
╭──────────────┬─────────────────────╮
│ letters ┆ letters_capitalized │
│ --- ┆ --- │
│ List[String] ┆ List[String] │
╞══════════════╪═════════════════════╡
│ [a, b, a] ┆ [A, B, A] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ [b, c, b, c] ┆ [B, C, B, C] │
╰──────────────┴─────────────────────╯
(Showing first 2 of 2 rows) Source code in daft/functions/list.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |