Skip to content

Change UInt64Index._na_value from 0 to np.nan #18398

Closed
@jschendel

Description

@jschendel

Code Sample, a copy-pastable example if possible

In [2]: pd.UInt64Index._na_value
Out[2]: 0

Problem description

The basic logic here is that UInt64Index should mimic Int64Index in that it cannot hold na. As it's currently defined, UInt64Index can hold it's _na_value, which brings about issues for internal code that uses _na_value.

Relevant discussion here.

Simply making the change from 0 to np.nan breaks a couple tests, and brings to light an existing bug, so there's a little more work than just changing _na_value. Will submit a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsMissing-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