forked from extern/nushell
fix typos and incorrect commands
This commit is contained in:
parent
f9fbb0eb3c
commit
2f5eeab567
@ -1,5 +1,8 @@
|
||||
# average This command allows you to calculate the average of values in a column. ## Examples
|
||||
To get the average of the file sizes in a directory, simply pipe the size column from the ls command to the sum command.
|
||||
# average
|
||||
This command allows you to calculate the average of values in a column.
|
||||
|
||||
## Examples
|
||||
To get the average of the file sizes in a directory, simply pipe the size column from the ls command to the average command.
|
||||
|
||||
```shell
|
||||
> ls | get size | average
|
||||
@ -19,8 +22,8 @@ To get the average of the file sizes in a directory, simply pipe the size column
|
||||
━━━━━━━━━
|
||||
```
|
||||
|
||||
Note that average only works for integer and byte values at the moment, and if the shell doesn't recognize the values in a column as one of those types, it will return an error.
|
||||
One way to solve this is to convert each row to an integer and then pipe the result to `average`
|
||||
Note that average only works for integer and byte values. If the shell doesn't recognize the values in a column as one of those types, it will return an error.
|
||||
One way to solve this is to convert each row to an integer when possible and then pipe the result to `average`
|
||||
|
||||
```shell
|
||||
> open tests/fixtures/formats/caco3_plastics.csv | get tariff_item | average
|
||||
|
@ -1,4 +1,7 @@
|
||||
# sum This command allows you to calculate the sum of values in a column. ## Examples
|
||||
# sum
|
||||
This command allows you to calculate the sum of values in a column.
|
||||
|
||||
## Examples
|
||||
To get the sum of the file sizes in a directory, simply pipe the size column from the ls command to the sum command.
|
||||
|
||||
```shell
|
||||
@ -10,7 +13,7 @@ To get the sum of the file sizes in a directory, simply pipe the size column fro
|
||||
━━━━━━━━━
|
||||
```
|
||||
|
||||
To get the sum of the characters in your present working directory.
|
||||
To get the sum of the characters that make up your present working directory.
|
||||
```shell
|
||||
> pwd | split-row / | size | get chars | sum
|
||||
━━━━━━━━━
|
||||
@ -20,13 +23,11 @@ To get the sum of the characters in your present working directory.
|
||||
━━━━━━━━━
|
||||
```
|
||||
|
||||
|
||||
|
||||
Note that sum only works for integer and byte values at the moment, and if the shell doesn't recognize the values in a column as one of those types, it will return an error.
|
||||
One way to solve this is to convert each row to an integer and then pipe the result to `sum`
|
||||
Note that sum only works for integer and byte values. If the shell doesn't recognize the values in a column as one of those types, it will return an error.
|
||||
One way to solve this is to convert each row to an integer when possible and then pipe the result to `sum`
|
||||
|
||||
```shell
|
||||
> open tests/fixtures/formats/caco3_plastics.csv | get tariff_item | average
|
||||
> open tests/fixtures/formats/caco3_plastics.csv | get tariff_item | sum
|
||||
error: Unrecognized type in stream: Primitive(String("2509000000"))
|
||||
- shell:1:0
|
||||
1 | open tests/fixtures/formats/caco3_plastics.csv | get tariff_item | sum
|
||||
|
Loading…
Reference in New Issue
Block a user