python中pandas输出完整、对齐的表格的方法
作者:wulei_1107103372 时间:2021-03-31 11:13:46
今天使用python计算数据相关性,但是发现计算出的表格中间好多省略号,而且也不对齐。
这也太难看了。
于是在程序里加了三行:
pd.set_option('display.max_columns', 1000)
pd.set_option('display.width', 1000)
pd.set_option('display.max_colwidth', 1000)
输出结果如下,输出结果已经全部显示了:
但是依然不对齐。
于是又加了两行:
pd.set_option('display.unicode.ambiguous_as_wide', True)
pd.set_option('display.unicode.east_asian_width', True)
运行结果对齐了,但仍然有瑕疵,不过已经好多了:
来源:https://blog.csdn.net/wulei_1107103372/article/details/105258600
标签:python,pandas,输出,表格
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Dreamweaver使用技巧之如何巧用DW4文件库更新网站
2010-10-20 20:07:00
![](https://img.aspxhome.com/file/UploadPic/20072/20072311301764s.gif)
Python计算信息熵实例
2022-08-17 16:13:39
![](https://img.aspxhome.com/file/2023/0/103300_0s.jpg)
Python3中bytes类型转换为str类型
2022-05-19 16:47:31
![](https://img.aspxhome.com/file/2023/6/111936_0s.png)
在Python中使用Neo4j的方法
2023-01-16 04:12:39
![](https://img.aspxhome.com/file/2023/5/103165_0s.png)
详解MySQL 数据库优化方法
2010-08-12 14:50:00
Python容器类型公共方法总结
2022-06-24 23:58:06
JavaScript防抖与节流超详细全面讲解
2023-09-22 07:05:13
![](https://img.aspxhome.com/file/2023/4/55984_0s.gif)
Python发送邮件封装实现过程详解
2021-06-13 09:19:41
![](https://img.aspxhome.com/file/2023/4/118744_0s.png)
Python实现按特定格式对文件进行读写的方法示例
2022-06-07 22:59:57
![](https://img.aspxhome.com/file/2023/8/118758_0s.png)
Scrapy框架爬取Boss直聘网Python职位信息的源码
2022-06-30 21:02:47
![](https://img.aspxhome.com/file/2023/1/111931_0s.png)
详解Python自建logging模块
2023-12-21 02:28:50
Python中的exec、eval使用实例
2022-07-05 21:01:41
Python基础教程之异常处理详解
2022-06-10 07:52:17
Python利用zhdate模块实现农历日期处理
2023-03-07 22:10:20
详解Python用户登录接口的方法
2021-10-09 23:26:48
![](https://img.aspxhome.com/file/2023/1/93871_0s.jpg)
高考要来啦!用Python爬取历年高考数据并分析
2021-06-10 04:08:25
![](https://img.aspxhome.com/file/2023/9/68439_0s.jpg)
SQLServer 2005 实现数据库同步备份 过程-结果-分析
2012-07-11 15:56:55
苹果Macbook Pro13 M1芯片安装Pillow的方法步骤
2021-01-11 18:23:46
python输出电脑上所有的串口名的方法
2022-06-23 20:56:03
![](https://img.aspxhome.com/file/2023/2/112732_0s.jpg)
Django+Ajax+jQuery实现网页动态更新的实例
2023-02-11 03:23:19