Skip to content

Fillna a categories series with another series breaks #13628

Closed
@rsdenijs

Description

@rsdenijs

On pandas 0.18.1, for some values of a, b

Code Sample

pd.Categorical([1,2,None, None]).fillna(pd.Series([1,1, a, b]))

Expected Output

Either the same as

pd.Categorical([1, 2, a, b])

or

ValueError: fill value must be in categories

If a or b do not match the categories. This is what whe get when we do pd.Categorical([1, 2, None, None]).fillna(3)

Actual output

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
This error message seems rather unenlightening...

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCategoricalCategorical Data TypeTestingpandas testing functions or related to the test suitegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions