DataAPI.jl
DataAPI.jl copied to clipboard
isordered
This function is defined in CategoricalArrays.jl.
CategoricalArrays.isordered(x::CategoricalValue) = isordered(x.pool)
However, it is quite generic and would be beneficial to have it defined in DataAPI.jl as something like
DataAPI.isordered(::Any) = false
DataAPI.isordered(obj::AbstractVector) = issorted(obj)
Thoughts?
Indeed it would be good to add it and it was discussed. Note that isordered
is not the same as issorted
.
This is related to https://github.com/JuliaLang/julia/pull/37239 and Ordered
trait
Yes, I'm in favor of this; in Arrow.jl, a dict-encoded column can define whether it's isOrdered
as well, so it could leverage this as well.
This should be added also for DataFrames.jl
@Nosferican Could you develop the use case do you have in mind? This is important to decide how to define the trait IMO. See https://github.com/JuliaData/DataAPI.jl/pull/26.