Skip to content

DEPR: automatic upcasting on invalid reindex fill_value #53910

@jbrockmendel

Description

@jbrockmendel
ser = pd.Series([1, 2, 3])

>>> ser.reindex([4, 5, 6], fill_value="foo")
4    foo
5    foo
6    foo
dtype: object

PDEP-6 is moving us away from automatic upcasting in __setitem__-like operations. #53868 and #53802 suggest doing the same (with possible int->float exception) for unstack and shift, respectively. I think that just leaves reindex. Maybe we should call this behavior a footgun and deprecate it across the board?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions