Skip to content

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

Closed
@jbrockmendel

Description

@jbrockmendel
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions