首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >iPython包装输出

iPython包装输出
EN

Stack Overflow用户
提问于 2018-01-14 23:35:31
回答 1查看 398关注 0票数 1

我使用print(df.head)显示超过114个字符的pandas表。pandas列宽使用pd.set_option(‘display.max_ column’,500)设置为500。但jupytr将这行代码换行为大约114个字符。我尝试使用下面的代码设置最大宽度,但似乎不影响宽度。

代码语言:javascript
复制
%%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>
EN

回答 1

Stack Overflow用户

发布于 2018-06-24 05:38:26

特别是对于熊猫,这应该打印出320个字符,例如

代码语言:javascript
复制
desired_width = 320
pd.set_option('display.width', desired_width)
pd.set_option("display.max_columns", 10)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48251188

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档