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 was archived by the owner on May 4, 2019. It is now read-only.
According to the spec, unique(A) should not re-order elements. However, it does for DataArrays:
julia> A = sort(rand(100)); # Get some data, sorted for simplicity
julia> DA = DataArray(A);
julia> all(diff(unique(A)) .>= 0) # Test that this works for regular arrays
true
julia> all(diff(unique(DA)) .>= 0) # It doesn't work for DataArrays!
false
julia> all(diff(unique(DA.data)) .>= 0) # It DOES work for the underlying data
true
Note that this is a problem even without any 'NA` values.
For sorted data this isn't really a big problem, as I can just re-sort it again, but for data that is not sorted but where ordering is important (such as experimental observations) that's not an option either.
sort(A::DataArray) throws error when missing values
i.e. it Just Works(TM). However, if there are missing values:
julia> DA[35] = NA;
julia> sort(DA)
ERROR: no method isnan(ForwardOrdering, NAtype)
in nans2right! at sort.jl:409
in fpsort! at sort.jl:428
in sort! at sort.jl:441
in sort at sort.jl:334
I'd prefer if it "just worked" and placed all NA values last...