Search code examples
pythonpandasvisual-studio-code

How to increase line length in VSCode Jupyter output?


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?

Print of notebook 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)

Solution

  • try adding also with the max rows settings:

    pd.set_option('display.max_rows', None)
    pd.set_option('display.max_columns', None)
    pd.set_option('display.expand_frame_repr', False)