如何更改我的熊猫数据框输出格式,例如自动调整列大小

时间:2019-09-26 08:23:51

标签: python pandas dataframe format

我新安装了pandas和python,但pandas数据框的结果与通常的类型不同。我试图升级熊猫和ipython,但这些都不起作用。This is my desired dataframe format for displaying

This is what I have right now

1 个答案:

答案 0 :(得分:0)

尝试一下:

import pandas as pd
pd.set_option('display.max_columns', 200) # increase the number of visible columns in output to 200
pd.set_option('display.max_rows', 200) # increase the number of visible rows in output to 200

编辑:

将以下代码粘贴到任何单元格中,它应该对您有用:

%%HTML
<style type="text/css">
table.dataframe td, table.dataframe th {
border: none !important;
color: black !important;
}
</style>

Styling for no borders can be done by using the HTML style tags

相关问题