Pandas display.max_rows and display.max_colwidth not working in jupyter notebook

Viewed 270

Pandas and jupyter notebook are not working as intended on my computer. This is the code:

import pandas as pd
pd.set_option("max_colwidth", 4, "display.max_rows", 5)
pd.DataFrame({1: ['1' * 1000] * 10000000})

But as you can see in the screenshot below, neither of the settings are working error in pandas

I want the 1's to be truncated and the rows as well but it isn't working

2 Answers

Please check the picture I have attached, is it what you want?

enter image description here

The pandas version that I was on was not the latest.

Broken version: pandas 1.3.0
Working version (latest as of 9/9/22): pandas 1.4.4

Related