默认情况下,使用__repr__或to_string列截断为50个字符.在早于0.13.1的Pandas版本中,可以使用pandas.set_printoptions()来控制它:
In [64]: df
Out[64]:
A B
a this is a very long string, longer than the defau bar
b foo baz
In [65]: pandas.set_printoptions(max_colwidth=100)
In [66]: df
Out[66]:
A B
a this is a very long string, longer than the default max_column width bar
b foo baz
在更新版本的Pandas中,请改用:
pd.options.display.max_colwidth = 100