mirror of
https://github.com/nushell/nushell.git
synced 2024-12-26 00:50:03 +01:00
Add missing math commands to docs (#2447)
This commit is contained in:
parent
6535ae3d6e
commit
c14b209276
@ -5,11 +5,14 @@ Currently the following functions are implemented:
|
|||||||
|
|
||||||
* `math avg`: Finds the average of a list of numbers or tables
|
* `math avg`: Finds the average of a list of numbers or tables
|
||||||
* [`math eval`](math-eval.md): Evaluates a list of math expressions into numbers
|
* [`math eval`](math-eval.md): Evaluates a list of math expressions into numbers
|
||||||
* `math min`: Finds the minimum within a list of numbers or tables
|
|
||||||
* `math max`: Finds the maximum within a list of numbers or tables
|
* `math max`: Finds the maximum within a list of numbers or tables
|
||||||
* `math median`: Finds the median of a list of numbers or tables
|
* `math median`: Finds the median of a list of numbers or tables
|
||||||
|
* `math min`: Finds the minimum within a list of numbers or tables
|
||||||
|
* `math mode`: Finds the most frequent element(s) within a list of numbers or tables
|
||||||
|
* `math stddev`: Finds the standard deviation of a list of numbers or tables
|
||||||
* `math sum`: Finds the sum of a list of numbers or tables
|
* `math sum`: Finds the sum of a list of numbers or tables
|
||||||
* `math product`: Finds the product of a list of numbers or tables
|
* `math product`: Finds the product of a list of numbers or tables
|
||||||
|
* `math variance`: Finds the variance of a list of numbers or tables
|
||||||
|
|
||||||
However, the mathematical functions like `min` and `max` are more permissive and also work on `Dates`.
|
However, the mathematical functions like `min` and `max` are more permissive and also work on `Dates`.
|
||||||
|
|
||||||
@ -91,11 +94,29 @@ To get the average of the file sizes in a directory, simply pipe the size column
|
|||||||
───┴──────────
|
───┴──────────
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> echo [3 3 9 12 12 15] | math mode
|
||||||
|
───┬────
|
||||||
|
0 │ 3
|
||||||
|
1 │ 12
|
||||||
|
───┴────
|
||||||
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
> echo [2 3 3 4] | math product
|
> echo [2 3 3 4] | math product
|
||||||
72
|
72
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> echo [1 4 6 10 50] | math stddev
|
||||||
|
18.1372
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> echo [1 4 6 10 50] | math variance
|
||||||
|
328.96
|
||||||
|
```
|
||||||
|
|
||||||
### Dates
|
### Dates
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
Loading…
Reference in New Issue
Block a user