Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python Pandas still prints ellipsis after setting max columns and row width

I have a long list which prints out everything as supposed to except one column that prints its rows with ellipsis because it holds a long value

tried:

pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)

they both seem to work untill a certain point, both jupyter-notebook and output saved into a log gives the same output.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

As shown here

Any help is highly appreciated!

>Solution :

You don’t use the right option.

From the documentation:

display.max_colwidth sets the maximum width of columns. Cells of this length or longer will be truncated with an ellipsis.

display.max_colwidth : int or None
The maximum width in characters of a column in the repr of
a pandas data structure. When the column overflows, a "…"
placeholder is embedded in the output. A ‘None’ value means unlimited.
[default: 50] [currently: 50]

pd.set_option('display.max_colwidth', None)
print(df)

# Output
0  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading