Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.
This repository was archived by the owner on May 4, 2019. It is now read-only.

Unhelpful error with quantile!(x, q) #174

Open
@JockLawrie

Description

@JockLawrie

Hi there,
When computing quantiles on DataArrays, if the DataArray contains an NA I get an error that could be more helpful. See example below.

using DataArrays

x = DataArray(Int64, 3)
x[1] = 1
x[2] = 2
x[3] = 3
quantile!(x, [0.5])    # OK, no problem

x[3] = NA
quantile!(x, [0.5])    # Unhelpful error

The error is:
ERROR: MethodError: isnan has no method matching isnan(::DataArrays.NAtype) in quantile! at statistics.jl:528

The source code of statistics.jl has the message "quantiles are undefined in presence of NaNs", which is more helpful. How can this message be shown rather than the one currently shown?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions