Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用.head()方法更改Pandas中单元格中打印的文本量_Python_Pandas - Fatal编程技术网

Python 使用.head()方法更改Pandas中单元格中打印的文本量

Python 使用.head()方法更改Pandas中单元格中打印的文本量,python,pandas,Python,Pandas,我想使用.head()方法打印数据集值的全文 实现这一目标的最佳方式是什么 0行中缩减文本的下图 pd.set_option('display.max_colwidth', -1) 在那里使用-1可以有效地关闭列宽。你可以传递任何你想传递的长度 从文件中: display.max\u columnwidth设置列的最大宽度。此长度或更长的单元格将被省略号截断。由于pandas 1.0: 根据,应使用None标志,而不是-1 pd.set_option("display.max_co

我想使用
.head()
方法打印数据集值的全文

实现这一目标的最佳方式是什么

0
行中缩减文本的下图

pd.set_option('display.max_colwidth', -1)

在那里使用-1可以有效地关闭列宽。你可以传递任何你想传递的长度

从文件中:


display.max\u columnwidth设置列的最大宽度。此长度或更长的单元格将被省略号截断。

由于pandas 1.0:

根据,应使用
None
标志,而不是
-1

pd.set_option("display.max_colwidth", None)

默认情况下,列宽度设置为80个字符。您可以使用
pd.set\u选项('display.max\u colwidth',-1)
更改此设置,以获得无限制的列宽度,但不建议这样做。该问题更一般,但不解决。head()具体来说,这个问题的答案和你的答案是一样的,但我在搜索中没有找到,我也不清楚这是真的。