6

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.

enter image description here

Union find
  • 7,759
  • 13
  • 60
  • 111

2 Answers2

7
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.

fixxxer
  • 15,568
  • 15
  • 58
  • 76
3

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)
LoicM
  • 1,786
  • 16
  • 37