dataframe print不好看
时间: 2023-08-20 21:05:51 浏览: 218
要解决DataFrame打印不好看的问题,可以根据以下几种方法来改善打印效果。
方法一: 使用pandas.set_option()函数来改变默认参数。通过设置display.width和display.max_rows来改变显示宽度和行数的限制。例如,使用pd.set_option('display.width', None)将字符显示宽度设置为无限制,使用pd.set_option('display.max_rows', None)将行数显示设置为无限制。这样就可以完整地查看数据了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [在Python中Dataframe通过print输出多行时显示省略号的实例](https://download.csdn.net/download/weixin_38728276/12865511)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Python中Dataframe通过print输出多行时显示省略号](https://blog.csdn.net/marypiglwy/article/details/124895748)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [打印dataframe数据不对齐](https://blog.csdn.net/Fearao/article/details/126510553)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文