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
It's strange that I have realized it only now, but unique(v::CategoricalArray{S}) returns Vector{S}, and not the categorical array of the same type as v.
Should it actually preserve the type of v to conform to the Base.unique() definition?
Otherwise some user code that should work regardless of the vector type (e.g. Vector{String} or CategoricalVector{String}) produces errors.
The text was updated successfully, but these errors were encountered:
This is consistent with the docstring of unique for CategoricalArray:
Return levels which appear in A in their order of appearance. This function is significantly slower than levels since it needs to check whether levels are used or not.
However, indeed, it is strange and I would also expect CategoricalArray.
It's strange that I have realized it only now, but
unique(v::CategoricalArray{S})
returnsVector{S}
, and not the categorical array of the same type asv
.Should it actually preserve the type of
v
to conform to theBase.unique()
definition?Otherwise some user code that should work regardless of the vector type (e.g.
Vector{String}
orCategoricalVector{String}
) produces errors.The text was updated successfully, but these errors were encountered: