Skip to content

Commit

Permalink
set start=-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Sep 6, 2024
1 parent 811bf32 commit 3b24db7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2396,12 +2396,12 @@ def _str_rpartition(self, sep: str, expand: bool) -> Self:
def _str_slice(
self, start: int | None = None, stop: int | None = None, step: int | None = None
) -> Self:
if step is not None and step < 0:
# GH#59710
result = self._apply_elementwise(lambda x: x[start:stop:step])
return type(self)(pa.chunked_array(result))
if start is None:
start = 0
if step is not None and step < 0:
# GH#59710
start = -1
else:
start = 0
if step is None:
step = 1
return type(self)(
Expand Down

0 comments on commit 3b24db7

Please sign in to comment.