mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-14 17:48:31 +00:00
Update cheatsheets
This commit is contained in:
39
linux/datamash
Normal file
39
linux/datamash
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# datamash
|
||||
|
||||
> Perform basic numeric, textual and statistical operations on input textual data files.
|
||||
> More information: <http://www.gnu.org/software/datamash/>.
|
||||
|
||||
- Get max, min, mean and median of a single column of numbers:
|
||||
|
||||
`seq 3 | datamash max 1 min 1 mean 1 median 1`
|
||||
|
||||
- Get the mean of a single column of float numbers (floats must use "," and not "."):
|
||||
|
||||
`echo -e '1.0
|
||||
2.5
|
||||
3.1
|
||||
4.3
|
||||
5.6
|
||||
5.7' | tr '.' ',' | datamash mean 1`
|
||||
|
||||
- Get the mean of a single column of numbers with a given decimal precision:
|
||||
|
||||
`echo -e '1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
5' | datamash -R {{number_of_decimals_wanted}} mean 1`
|
||||
|
||||
- Get the mean of a single column of numbers ignoring "Na" and "NaN" (literal) strings:
|
||||
|
||||
`echo -e '1
|
||||
2
|
||||
Na
|
||||
3
|
||||
NaN' | datamash --narm mean 1`
|
||||
Reference in New Issue
Block a user