HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

csvstat — Print descriptive statistics for all columns in a CSV file. Included in csvkit. More information: <h

Submitted by: @import:tldr-pages··
0
Viewed 0 times
descriptivecommandallcsvstatcliprintstatisticsfor

Problem

How to use the csvstat command: Print descriptive statistics for all columns in a CSV file. Included in csvkit. More information: <https://csvkit.readthedocs.io/en/latest/scripts/csvstat.html>.

Solution

csvstat — Print descriptive statistics for all columns in a CSV file. Included in csvkit. More information: <https://csvkit.readthedocs.io/en/latest/scripts/csvstat.html>.

Show all stats for all columns:
csvstat {{data.csv}}


Show all stats for columns 2 and 4:
csvstat {{[-c|--columns]}} {{2,4}} {{data.csv}}


Show sums for all columns:
csvstat --sum {{data.csv}}


Show the max value length for column 3:
csvstat {{[-c|--columns]}} {{3}} --len {{data.csv}}


Show the number of unique values in the "name" column:
csvstat {{[-c|--columns]}} {{name}} --unique {{data.csv}}

Code Snippets

Show all stats for all columns

csvstat {{data.csv}}

Show all stats for columns 2 and 4

csvstat {{[-c|--columns]}} {{2,4}} {{data.csv}}

Show sums for all columns

csvstat --sum {{data.csv}}

Show the max value length for column 3

csvstat {{[-c|--columns]}} {{3}} --len {{data.csv}}

Show the number of unique values in the "name" column

csvstat {{[-c|--columns]}} {{name}} --unique {{data.csv}}

Context

tldr-pages: common/csvstat

Revisions (0)

No revisions yet.