希望我希望使用 pandas 和 IPython 返回一些我想要复制和粘贴的 HTML 嵌入代码。
问题是输出被裁剪。如何更改设置才能看到完整的结果?
这是一个例子:
<h2>Evil Trent</h2><iframe width="560" height=...
如果我使用 df.ix[0] 选择单个元素,您可以看到完整的结果。
<h2>Evil Trent</h2><iframe width="560" height="315" src="//www.youtube.com/embed/qvX8cfMUPqg" frameborder="0" allowfullscreen></iframe><p>Published by Evan Leonard on Monday August 05.</p>
我想要的是查看其余的输出。这是 Chrome 上 IPython 的简单设置问题吗?
最佳答案
尝试将 option.display.max_colwidth
设置为更大的值:
In [11]: df
Out[11]:
0
0 <h2>Evil Trent</h2><iframe width="560" height=...
In [12]: pd.options.display.max_colwidth
Out[12]: 50
增加到 200 似乎就可以了:
In [13]: pd.options.display.max_colwidth = 200
In [14]: df
Out[14]:
0
0 <h2>Evil Trent</h2><iframe width="560" height="315" src="//www.youtube.com/embed/qvX8cfMUPqg" frameborder="0" allowfullscreen></iframe><p>Published by Evan Leonard on Monday August 05.</p>
关于pandas - IPython/pandas 中的格式问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18067587/