How to get a quick description of a vector/matrix like `pd.DataFrame.describe`

Yes:

julia> df = DataFrame(x1 = rand('a':'z', 50), x2 = rand(50), x3 = rand(Int, 50));

julia> describe(df)
3×7 DataFrame
 Row │ variable  mean         min                   median       max                  nmissing  eltype
     │ Symbol    Union…       Any                   Union…       Any                  Int64     DataType
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ x1                     b                                  z                           0  Char
   2 │ x2        0.557368     0.0171211             0.61268      0.980724                    0  Float64
   3 │ x3        -8.54368e17  -9192866872846841147  -1.90444e18  8714825590927121417         0  Int64

you can also pass extra arguments to customize which metrics are calculated:

julia> describe(df, :q75, :nunique, :first, :last)
3×5 DataFrame
 Row │ variable  q75         nunique  first                last
     │ Symbol    Union…      Union…   Any                  Any
─────┼────────────────────────────────────────────────────────────────────────
   1 │ x1                    22       k                    d
   2 │ x2        0.766689             0.795076             0.252337
   3 │ x3        3.48812e18           3819380600561978128  913260025103986027

(allowed arguments are :mean, :std, :min, :q25, :median, :q75, :max, :nunique, :nmissing, :first, :last, :eltype)

2 Likes