我使用print(df.head)显示超过114个字符的pandas表。pandas列宽使用pd.set_option(‘display.max_ column’,500)设置为500。但jupytr将这行代码换行为大约114个字符。我尝试使用下面的代码设置最大宽度,但似乎不影响宽度。
%%html
<style>
.output_wrapper, .output {
height:auto !important;
max-height:1000px; /* your desired max-height here */
max-width: 1000px;
}
.output_scroll {
box-shadow:none !important;
webkit-box-shadow:none !important;
}
</style>
发布于 2018-06-24 05:38:26
特别是对于熊猫,这应该打印出320个字符,例如
desired_width = 320
pd.set_option('display.width', desired_width)
pd.set_option("display.max_columns", 10)
https://stackoverflow.com/questions/48251188
复制相似问题