mlr --csv stats1 -a mean,min,max -f score data.csv

Category: Data Science & Analysis

mlr --csv stats1 -a mean,min,max -f score data.csv

Compute mean, min, and max of the score column

The stats1 verb computes one-pass aggregations over the fields named by -f, here score. The -a flag lists which statistics to produce, with mean, min, and max being the common starting set. Output is one row per input field per statistic. Add -g dept to compute these same numbers separately for each department.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.