You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2019. It is now read-only.
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] =3quantile!(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?
The text was updated successfully, but these errors were encountered:
This is because the generic implementation for AbstractArray is used, instead of a specific method for DataArray. You could easily fix this by copying the general method, restricting its signature to DataArrays, and adding a check for isna before that for isnan.
(But these days, the development focus has moved towards NullableArrays.jl, which offers a much better performance and will eventually replace DataArrays.jl.)
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.
The error is:
ERROR: MethodError:
isnan
has no method matching isnan(::DataArrays.NAtype) in quantile! at statistics.jl:528The 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?
The text was updated successfully, but these errors were encountered: