Skip to content

BUG: ser.loc[-1] and ser.loc[[-1]] with UInt64Index #41775

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
jbrockmendel opened this issue Jun 2, 2021 · 1 comment · Fixed by #41777
Closed

BUG: ser.loc[-1] and ser.loc[[-1]] with UInt64Index #41775

jbrockmendel opened this issue Jun 2, 2021 · 1 comment · Fixed by #41777
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jbrockmendel
Copy link
Member

umax = np.iinfo(np.uint64).max
ser = pd.Series([0, 1], index=[umax-1, umax])

>>> ser.loc[-1]  # <- should raise KeyError
OverflowError: can't convert negative value to npy_uint64

>>> ser.loc[[-1]]  # <- should raise KeyError
18446744073709551615    1
dtype: int64
@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 2, 2021
@jreback jreback added this to the 1.3 milestone Jun 2, 2021
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 2, 2021
@jreback
Copy link
Contributor

jreback commented Jun 2, 2021

can you add a whatsnew, lgtm

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 Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants