用pandas展示数据输出时列名不能对齐

用pandas展示数据输出时列名不能对齐

列名用了中文的缘故,设置pandas的参数即可,代码如下:

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

猜你喜欢

转载自blog.csdn.net/qq_37816095/article/details/86005660
今日推荐