datamash -t, --header-in perc:95 4 < data.csv

Category: Data Science & Analysis

datamash -t, --header-in perc:95 4 < data.csv

Compute the 95th percentile of column 4

The perc:95 operation reports the 95th percentile, the value below which 95 percent of the data falls. Percentiles summarize the shape of a column better than the mean when outliers are present. Change the number to get any percentile, such as perc:50 for the median. Pair it with -g to get per-group percentiles.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.