math mode
for math
Returns the most frequent element(s) from a list of numbers or tables.
Signature
> math mode {flags}
Input/output types:
input | output |
---|---|
list<duration> | list<duration> |
list<filesize> | list<filesize> |
list<number> | list<number> |
table | record |
Examples
Compute the mode(s) of a list of numbers
> [3 3 9 12 12 15] | math mode
╭───┬────╮
│ 0 │ 3 │
│ 1 │ 12 │
╰───┴────╯
Compute the mode(s) of the columns of a table
> [{a: 1 b: 3} {a: 2 b: -1} {a: 1 b: 5}] | math mode
╭───┬────────────╮
│ │ ╭───┬───╮ │
│ a │ │ 0 │ 1 │ │
│ │ ╰───┴───╯ │
│ │ ╭───┬────╮ │
│ b │ │ 0 │ -1 │ │
│ │ │ 1 │ 3 │ │
│ │ │ 2 │ 5 │ │
│ │ ╰───┴────╯ │
╰───┴────────────╯