I would like to print the full text of my dataset's values, using the .head()
method.
What is the best way to achieve this?
Photo below of curtailed text in the 0
row.
I would like to print the full text of my dataset's values, using the .head()
method.
What is the best way to achieve this?
Photo below of curtailed text in the 0
row.
pd.set_option('display.max_colwidth', -1)
Using a -1 there effectively turns off the column width. You can pass any length you want to instead.
From the documentation:
display.max_columnwidth sets the maximum width of columns. Cells of this length or longer will be truncated with an ellipsis.
The currently accepted answer is now deprecated since pandas 1.0:
as per the documentation, the None
flag should be used instead of -1
.
pd.set_option("display.max_colwidth", None)