math avg for math
Returns the average of a list of numbers.
Signature
> math avg {flags}
Input/output types:
| input | output |
|---|---|
| list<duration> | duration |
| duration | duration |
| list<filesize> | filesize |
| filesize | filesize |
| list<number> | number |
| number | number |
| range | number |
| table | record |
| record | record |
Examples
Compute the average of a list of numbers.
> [-50 100.0 25] | math avg 25.0
Compute the average of a list of durations.
> [2sec 1min] | math avg 31sec
Compute the average of each column in a table.
> [[a b]; [1 2] [3 4]] | math avg ╭───┬───╮ │ a │ 2 │ │ b │ 3 │ ╰───┴───╯
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/math_avg.html