Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ Indexing
^^^^^^^^
- Bug in :meth:`DataFrame.__getitem__` returning modified columns when called with ``slice`` in Python 3.12 (:issue:`57500`)
- Bug in :meth:`DataFrame.from_records` throwing a ``ValueError`` when passed an empty list in ``index`` (:issue:`58594`)
- Bug in :meth:`maybe_indices_to_slice` max_len was set to an int causing ``OverflowError``: value too large to convert to int when manipulating very large dataframes (:issue:`59531`)
-

Missing
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def maybe_booleans_to_slice(
) -> slice | npt.NDArray[np.uint8]: ...
def maybe_indices_to_slice(
indices: npt.NDArray[np.intp],
max_len: int,
max_len: np.intp,
) -> slice | npt.NDArray[np.intp]: ...
def is_all_arraylike(obj: list) -> bool: ...

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def has_only_ints_or_nan(const floating[:] arr) -> bool:
return True


def maybe_indices_to_slice(ndarray[intp_t, ndim=1] indices, int max_len):
def maybe_indices_to_slice(ndarray[intp_t, ndim=1] indices, intp_t max_len):
cdef:
Py_ssize_t i, n = len(indices)
intp_t k, vstart, vlast, v
Expand Down