-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Unicode column misalignment #2612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually, this may just be that monospace is not possible with chinese characters |
it would significantly impact performance but we could use unicodedata.east_asian_width to check whether the chars are double width. Maybe do this after we include a .pandas file so if you do work with east asian fonts you can have it on by default? |
Did some work on this. Turns out the monospace Chinese characters in question are exactly 2 monospace ASCII characters wide. commit 1002a365fb81291403ec43d253a5e97fdf3234f4 closes #2612 >>> df
測試一 測試三
0 abc@example.com 測試一
1 def@example.com 測試二
2 ghi@example.com 測試三 Now: >>> df
測試一 測試三
0 abc@example.com 測試一
1 def@example.com 測試二
2 ghi@example.com 測試三 The fix correctly calculates the width of the three (Chinese) character data as six display characters. Not sure why it's not also fixing the header display. |
let's push to 0.14, once |
Looked little, and colwidth should handle other 4 Eastern Asia widthes('Na', 'N', 'H', 'A') . Also, I think My current resulthttps://github.com/sinhrks/pandas/tree/unicode_justify
|
Hello, this is very important issue for Japanese, Chinese, Korean |
@sinhrks I think you have a branch with a possible fix? can you reinvigorate when you have a chance. thxs. |
Sure. The blocker was how to write a test both work on py2 and 3 (can't use escaped unicode because it changes eastern asia width). Now we can use |
right. further if we need to have an option (ok by me), i would use |
The text was updated successfully, but these errors were encountered: