jorisvandenbossche commented on issue #15053:
URL: https://github.com/apache/arrow/issues/15053#issuecomment-2317032347

   Hmm, ok so it seems, based on the single example above, we missed how Python 
actually works .. It doesn't just align on the right side (e.g `'XXbbX'`), but 
so apparently they align on the left or right depending on whether the total 
width is odd or even .. (maybe a bit similar like round-to-even logic?)
   
   One lucky part might be that this addition in pyarrow might not completely 
miss the point, because I think we can mimic that behaviour in pandas exactly 
(if we want), by doing something like:
   
   ```python
   if width % 2 == 0:
       # width is even
       lean_left = True
   else:
       lean_left = False
   
   pc.utf8_center(arr, width, padding=fillchar, 
lean_left_on_odd_padding=lean_left)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to