datamash -t, --header-in mean 2 median 2 pstdev 2 < data.csv

Category: Data Science & Analysis

datamash -t, --header-in mean 2 median 2 pstdev 2 < data.csv

Show mean, median, and population stddev of column 2

Computes three statistics for column 2 in one pass: the mean (average), the median (middle value when sorted), and pstdev (population standard deviation, a measure of how spread out values are around the mean). Multiple operation and field pairs can follow each other, so mean 2 median 2 pstdev 2 all run in a single command. Each statistic is a separate keyword, which keeps the syntax readable.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.