Skip to content

/config/pandas/display-max-columns

pandas display options: show all columns and rows (display.max_columns)

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated 2026-10-20
tool
pandas
file
pandas options (pd.set_option)
key
display.max_columns / display.max_rows
type
int or None
default
check with pd.get_option; it was 0 (fit to the output width) when this page was verified, max_rows 60

pandas shortens what it prints: wide DataFrames get ... in the middle and long ones show only the first and last rows. pd.set_option("display.max_columns", None) shows every column, display.max_rows does the same for rows, and pd.option_context(...) changes them for a single block of code.

Before and after

bash
python -c '
import pandas as pd
df = pd.DataFrame([[c for c in range(12)] for _ in range(2)], columns=[f"col{c}" for c in range(12)])
print("default max_columns:", pd.get_option("display.max_columns"))
pd.set_option("display.max_columns", 6)
print(df)
pd.set_option("display.max_columns", None)
pd.set_option("display.width", 200)
print(df)'

Output

default max_columns: 0
   col0  col1  col2  ...  col9  col10  col11
0     0     1     2  ...     9     10     11
1     0     1     2  ...     9     10     11

[2 rows x 12 columns]
   col0  col1  col2  col3  col4  col5  col6  col7  col8  col9  col10  col11
0     0     1     2     3     4     5     6     7     8     9     10     11
1     0     1     2     3     4     5     6     7     8     9     10     11

With a limit of 6, pandas shows the first and last three columns and a ... column in between; with None every column is printed.

Options you will use

OptionWhat it controlsShow everything
display.max_columnscolumns before truncating with ...None
display.max_rowsrows before truncatingNone
display.widthline width in charactersa large number, e.g. 400
display.max_colwidthcharacters per cell before ...None
display.precisiondecimal places for floats—
display.float_formatfunction to format floats'{:,.2f}'.format

Set them once, or for one print

python
import pandas as pd

pd.set_option("display.max_columns", None)       # for the whole session
pd.reset_option("display.max_columns")           # back to the default

with pd.option_context("display.max_rows", None, "display.max_columns", None):
    print(df)                                     # only inside this block

Sources