Skip to content

BUG: Index.fillna ignores 'downcast' #44048

Closed
@jbrockmendel

Description

@jbrockmendel

Issue Description

def fillna(self, value=None, downcast=None):
    value = self._require_scalar(value)
     if self.hasnans:
        result = self.putmask(self._isnan, value)
        if downcast is None:
             return Index._with_infer(result, name=self.name)
     return self._view()

In the case with downcast not None and self.hasnans, we fall through to return self._view() and ignore result. We don't have any such cases in the test suite.

Expected Behavior

Not ignoring result or downcast.

I'd be OK with deprecating the keyword; i expect it is just there to match NDFrame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexRelated to the Index class or subclassesMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions