Google colab 中的输出截断

Output Truncation in Google colab

[1]在 google colab 中,查看变量时,它总是在输出屏幕中的某个限制后截断

Colab,我尝试将字符串打印为整个偶数字符,但最后打印为 (...)

import pandas as pd 
d = {'Title': ["Hello, hope you are doing good, every one is fine in your place"]}
m = pd.DataFrame(d)
m['Title']

输出:

0 Hello, hope you are doing good, every one is f...

我需要查看整个字符串的完整输出。

[输出被截断] [1]:https://i.stack.imgur.com/ZZ7pJ.jpg

您正在观察 'feature' of Pandas,其中在格式化 DataFrame 对象时截断长字符串。

要配置截断限制,请使用:

pd.set_option('display.max_colwidth',1000)

(当然,您可以根据自己的喜好调整1000的值。)

之后,您的示例将产生预期的输出,如下所示: