Skip to content

Commit 3b24db7

Browse files
committed
set start=-1
1 parent 811bf32 commit 3b24db7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/core/arrays/arrow/array.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2396,12 +2396,12 @@ def _str_rpartition(self, sep: str, expand: bool) -> Self:
23962396
def _str_slice(
23972397
self, start: int | None = None, stop: int | None = None, step: int | None = None
23982398
) -> Self:
2399-
if step is not None and step < 0:
2400-
# GH#59710
2401-
result = self._apply_elementwise(lambda x: x[start:stop:step])
2402-
return type(self)(pa.chunked_array(result))
24032399
if start is None:
2404-
start = 0
2400+
if step is not None and step < 0:
2401+
# GH#59710
2402+
start = -1
2403+
else:
2404+
start = 0
24052405
if step is None:
24062406
step = 1
24072407
return type(self)(

0 commit comments

Comments
 (0)