Seems a bug for the layout for the Chinese Character
See original GitHub issueWith Chinese characters in the DataFrame, it seems the tabulate package cannot identify the correct width.
import pandas as pd
import tabulate
print(tabulate.__version__)
print(tabulate.WIDE_CHARS_MODE)
df = pd.DataFrame({
'序号':['001', '021', '032'],
'类型': ['汽车TESLA', '飞机737-MAX', 'TRAIN'],
'备注': ['特殊', '一长串字符', '字符+1020']
})
print(tabulate.tabulate(df, tablefmt="github"))
The Output is : 0.8.7 True |—|-----|-------------|------------| | 0 | 001 | 汽车TESLA | 特殊 | | 1 | 021 | 飞机737-MAX | 一长串字符 | | 2 | 032 | TRAIN | 字符+1020 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Problems with Chinese characters entered in layout window in ...
When a Chinese character text is created on a layout window and saved. It looks ok. ... But if the workspace is re-opened,...
Read more >Chinese symbol: 蟲, 虫, bug; worm; insect
Chinese symbol 蟲, 虫 in calligraphy format and mp3 pinyin pronunciation, English interpretations: bug; worm; insect.
Read more >Inconsistent rendering of Chinese characters - Bugzilla@Mozilla
I've been able to pinpoint the problem I think. When a web page doesn't specify a Chinese font in their CSS rules, Firefox...
Read more >Chinese Font auto layout bug - Figma Community Forum
When I use Chinese characters in the auto layout, I change the Text(Hug contents ... folded and will only appear on one line...
Read more >Email message body is garbled when Simplified Chinese ...
You create an email message with Simplified Chinese characters in the BCC field, ... In the Message format section, click International Options.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just checked the wcwidth package. Seems it is working properly.
@sidkang can you check if you have wcwidth at all installed (
pip freeze | grep wcwidth
)? It is an optional dependency, so python-tabulate would work happily without it, but the wide character alignment would be off. For example, my output with and without wcwidth: