Skip to content

Commit ac3c969

Browse files
committed
lean_left only on even
1 parent 584ba18 commit ac3c969

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/arrays/_arrow_string_mixins.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def _str_pad(
6363
return type(self)._from_sequence(result, dtype=self.dtype) # type: ignore[attr-defined]
6464
else:
6565
# GH#54792
66-
pa_pad = partial(pc.utf8_center, lean_left_on_odd_padding=False)
66+
# https://github.com/apache/arrow/issues/15053#issuecomment-2317032347
67+
lean_left = (width % 2) == 0
68+
pa_pad = partial(pc.utf8_center, lean_left_on_odd_padding=lean_left)
6769
else:
6870
raise ValueError(
6971
f"Invalid side: {side}. Side must be one of 'left', 'right', 'both'"

0 commit comments

Comments
 (0)