mlr --csv count-distinct -n -f dept data.csv

Category: Data Science & Analysis

mlr --csv count-distinct -n -f dept data.csv

Count distinct dept values without a header row

The -n flag suppresses the header line from count-distinct output, leaving just the bare count number. This makes the result directly usable in scripts or arithmetic pipelines. The plain form with header is friendlier for interactive use. Both variants count the same unique values of the dept field.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.