I have been looking at the source code for CategoricalArray
but I can’t figure this out.
vec = CategoricalArray([1,2,1,2])
t = vec[1]
# We know what levels
t.pool # CategoricalArrays.CategoricalPool{Int64,UInt32}([1,2])
newvec = CategoricalArray(fill(t, 5))
newvec.pool # CategoricalArrays.CategoricalPool{Int64,UInt32}([1])
# not [1, 2]
Because newvec.pool
is immutable, you can’t alter it after you create the vector.
Anyone have good enough knowledge of the constructors for CategoricalArrays
to help me with this?