Skip to content

EA: fillna should accept same type #32414

Closed
@jbrockmendel

Description

@jbrockmendel
cat = pd.Categorical(["A", "B", None, "A"])
ser = pd.Series(cat).fillna("B")

>>> filled = cat.fillna(ser)  # <-- works

>>> cat.fillna(filled)
TypeError: 'value' parameter must be a scalar, dict or Series, but you passed a Categorical

Metadata

Metadata

Assignees

No one assigned

    Labels

    CategoricalCategorical Data TypeExtensionArrayExtending pandas with custom dtypes or arrays.Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNeeds TestsUnit test(s) needed to prevent regressionsgood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions