I’m trying to print a pandas dataframe in a cell of a Jupyter Notebook. However, for some reason, the DataFrame is truncated at some point of the line and continues above. Any clue of how to increase the number of characters printed per line in the output?
More info:
-
The limit of characters also affects Debug Console. When trying to print the DataFrame in Debug Console, the same behaviour occurs.
-
I’m using the function print() to print the DataFrame
-
I’ve tried to change pandas options without success:
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
- I’ve tried this solution here. Didn’t work.
2
Answers
try adding also with the max rows settings:
The option you are looking for here is
display.width
, which is set to80
by default. By addingpd.set_option('display.width', None)
, you can disable this limit.So, for this example DataFrame:
Before setting the
pd.set_option('display.width', None)
:And after: