math median for math

Computes the median of a list of numbers.

Signature

> math median

Input/output types:

inputoutput
list<duration>duration
list<filesize>filesize
list<number>number
tablerecord

Examples

Compute the median of a list of numbers

> [3 8 9 12 12 15] | math median
10.5

Compute the medians of the columns of a table

> [{a: 1 b: 3} {a: 2 b: -1} {a: -3 b: 5}] | math median
╭───┬───╮
│ a │ 1 │
│ b │ 3 │
╰───┴───╯