Statistics.jl
Statistics.jl copied to clipboard
NaNs and quantile
Using DataFrames.describe
over a dataset with NaN
s gives an error, because quantiles
throws an error when the input has at least one NaN
.
DataFrames could manage that error using try
, but maybe quantiles
should return NaN
s when there are NaN
s in the input.
Related issue: https://github.com/JuliaLang/julia/issues/1142
julia> using RDatasets
julia> iris = dataset("datasets", "iris");
julia> iris[2,1] = NaN;
julia> describe(iris)
SepalLength
ERROR: ArgumentError: quantiles are undefined in presence of NaNs
in quantile! at statistics.jl:545
in quantile at statistics.jl:609
in describe at /home/dzea/.julia/v0.4/DataFrames/src/abstractdataframe/abstractdataframe.jl:413
in describe at /home/dzea/.julia/v0.4/DataFrames/src/abstractdataframe/abstractdataframe.jl:402
in describe at /home/dzea/.julia/v0.4/DataFrames/src/abstractdataframe/abstractdataframe.jl:398