juliajuliadb

How to use summarise function in JuliaDB?


I am following the tutorial published at https://github.com/JuliaComputing/JuliaDB.jl/blob/master/docs/src/tutorial.md
a) While executing:

summarize(mean ∘ skipmissing, flights, :Dest, select = (:Cancelled, :Diverted))

getting:

Error: UndefVarError: mean not defined

b) Also tried:

summarize(mean, dropna(flights), select = :dep_delay)

getting:

Error: UndefVarError: dropna not defined

Please help me in resolving the issue!


Solution

  • In order to use mean you must first import Statistics or StatsBase. The other problem is due to the fact that dropna should be dropmissing. Also you have a wrong variable name in the second operation.

    The lines that work are:

    using Statistics
    summarize(mean ∘ skipmissing, flights, :Dest, select = (:Cancelled, :Diverted))
    summarize(mean, dropmissing(flights), select = :DepDelay)