当前位置:主页 > 软件编程 > Python代码 >

解决pandas展示数据输出时列名不能对齐的问题

时间:2021-08-18 08:17:05 | 栏目:Python代码 | 点击:

列名用了中文的缘故,设置pandas的参数即可,

代码如下:

 import pandas as pd
 #这两个参数的默认设置都是False
 pd.set_option('display.unicode.ambiguous_as_wide', True)
 pd.set_option('display.unicode.east_asian_width', True)

您可能感兴趣的文章:

相关文章