Skip to content

Adding levels in CategoricalValue call #364

@bkamins

Description

@bkamins

@nalimilan In the following example:

julia> x = categorical([1,2,3])
3-element CategoricalArray{Int64,1,UInt32}:
 1
 2
 3

julia> CategoricalValue(3, x)
CategoricalValue{Int64, UInt32} 3

julia> CategoricalValue(4, x)
ERROR: ArgumentError: level 4 not found in source pool

The question is if maybe we should allow CategoricalValue(4, x) to add level to pool of x (if this would be allowed in assignment to x) rather than erroring?

I am not fully convinced though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions