tablecompute
.tablecompute column:{Int}
compute:{Lambda}
table:{MarkdownContent}
-> Node
Content copied to clipboard
Performs a computation on a specific column of a table, appending the result to a new cell in the bottom.
Example:
.tablecompute {2} {@lambda x: .x::average::round}
| Name | Age | City |
|------|-----|------|
| John | 25 | NY |
| Lisa | 32 | LA |
| Mike | 19 | CHI |
Content copied to clipboard
Result:
| Name | Age | City |
|------|-----|------|
| John | 25 | NY |
| Lisa | 32 | LA |
| Mike | 19 | CHI |
| | 25 | |
Content copied to clipboard
Return
the computed table, of size columns * (rows + 1)
Parameters
column
index of the column (starting from 1)
compute
a lambda function that returns any value, which is the output of the computation. The lambda accepts a single argument, which is the ordered collection of cell values of the column.