Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jschendel opened this issue Nov 21, 2017 · 0 comments · Fixed by #18401
Closed

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

jschendel opened this issue Nov 21, 2017 · 0 comments · Fixed by #18401
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Milestone

Comments

@jschendel
Copy link
Member

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.

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Nov 21, 2017
@jreback jreback added this to the 0.22.0 milestone Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants