Skip to content
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

BUG: NumericIndex should not support float16 dtype #49535

Closed
3 tasks done
topper-123 opened this issue Nov 4, 2022 · 0 comments · Fixed by #49536
Closed
3 tasks done

BUG: NumericIndex should not support float16 dtype #49535

topper-123 opened this issue Nov 4, 2022 · 0 comments · Fixed by #49536
Labels
Bug Index Related to the Index class or subclasses

Comments

@topper-123
Copy link
Contributor

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

>>> from pandas.core.api import NumericIndex
>>> idx = NumericIndex([1, 2, 3], dtype="float16")
>>> idx
NumericIndex([1, 2, 3], dtype="float16")  # should be float 32, see below
>>> idx.get_loc(1)
KeyError: 1

Issue Description

pandas doesn't have a float16 indexing engine (because khash doesn't have float16 hashing functionality), so can't/shouldn't have float16 index either. If a float16 array is given to NumericIndex, the index should be converted to a float32 index .

Expected Behavior

If a float16 array is given to NumericIndex, the index should be converted to a float32 index .

Installed Versions

Replace this line with the output of pd.show_versions()

@topper-123 topper-123 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 4, 2022
@lithomas1 lithomas1 added Index Related to the Index class or subclasses and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants