How to Show All Columns and Rows in a Pandas DataFrame

Here’s how to display all columns and rows of a pandas DataFrame by using pd.set_option.

Written by Andryw Marques
A row of stone columns
Image: Shutterstock / Built In
Brand Studio Logo
UPDATED BY
Brennan Whitfield | Jun 24, 2025
Summary: Use pd.set_option(‘display.max_columns’, None) to display all columns and pd.set_option(‘display.max_rows’, None) to display all rows in a Pandas DataFrame. You can also use display.max_colwidth, display.max_seq_items and precision to control truncation and formatting in Jupyter or scripts.

In this article, I’m going to explain how to display all of the columns and rows of a pandas DataFrame by using pd.set_option in pandas.

I’ll also explain how to show all values in a list inside a DataFrame and choose the precision of the numbers in a DataFrame.

How to Show All Columns and Rows in a Pandas DataFrame

To show all columns in a pandas DataFrame, use:

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

To show all rows in a pandas DataFrame, use:

pd.set_option('display.max_rows', None)

Sometimes you may read a DataFrame with a lot of rows or columns, but when you display it in Jupyter, the rows and columns are hidden (highlighted in the red boxes below):

import pandas as pd

movies = pd.read_csv('data/IMDB_Top250movies2_OMDB_Detailed.csv')

movies
Some rows and columns are hidden (red boxes).
Some rows and columns are hidden (red boxes). | Screenshot: Andryw Marques

They’re typically hidden to avoid displaying too much information. But sometimes you may want to see all the columns and rows. So, how do we print them all?

To do so, we need to play with the options parameters in Pandas. Let’s see.

I’ll be using the top 250 IMDB movies data set from Kaggle.

RelatedSorting Data Frames in Pandas: A Hands-On Guide

 

Showing all the values of the lists. | Screenshot: Andryw Marques

How to Show All Columns and Rows in Pandas

I’ll now go over the different commands you can use to manipulate how many columns and rows you can see in Pandas, including:

  • display.max_columns
  • display.max_rows and display.min_rows
  • display.max_colwidth
  • display.max_seq_items 

1. Show All Columns Using pd.set_option(‘display.max_columns’, None)

The display.max_columns option in Pandas controls the number of columns to be printed. It receives an int or None, the latter used to print all the columns:

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

movies.head()
The columns are not hidden anymore. Jupyter creates a scroll bar.
The columns are not hidden anymore. Jupyter creates a scroll bar. | Screenshot: Andryw Marques

Using max_columns

You can also use the string max_columns instead of display.max_columns since the option functions  can accept a regex:

pd.set_option('max_columns', None)

How to Specify Number of Displayed Columns

To pass a number instead of “None,” enter:

pd.set_option('max_columns', 2)

movies.head()
Showing only 2 columns.
Showing only 2 columns. | Screenshot: Andryw Marques

How to Reset Columns to Default Value

To go back to the default value, you need to reset the option:

pd.reset_option('max_columns')

movies.head()
Some columns are hidden again.
Some columns are hidden again. | Screenshot: Andryw Marques

2. Show All Rows Using pd.set_option(‘display.max_rows’, None)

To change the number of rows you need to change the max_rows option.

pd.set_option('display.max_rows', None) #Showing all rows

pd.set_option('display.max_columns', 2) #Showing only two columns

movies
All the rows are being shown. Jupyter collapses the cell and creates a scroll bar.
All the rows are being shown. Jupyter collapses the cell and creates a scroll bar. | Screenshot: Andryw Marques

Using max_rows and min_rows

Related to rows, there are two settings: max_rows and min_rows. When the number of rows is greater than max_rows, the DataFrame is truncated and it shows min_rows rows.

For example, let’s print the movies DataFrame again along with the default values of max_rows and min_rows:

print('Default max_rows: {} and min_rows: {}'.format(
pd.get_option('max_rows'), pd.get_option('min_rows')))

movies
Printing the movies DatFrame with max_rows and min_rows.
Printing the movies DataFrame with max_rows and min_rows. | Image: Andryw Marques

Since the number of rows in the DataFrame is 250, which is more than the max_rows value 60, it shows the first and last five rows, which is the min_rows value we set at 10.

If we change min_rows to 2, it will only display the first and the last rows:

pd.set_option('min_rows', 2)

movies
Showing only 2 rows, the first and the last.
Showing only 2 rows, the first and the last. | Screenshot: Andryw Marques

If we use the head command with a value below the max_rows value (60), all the rows are shown. For example, using head with value 20:

movies.head(20)
Showing all the 20 rows because this value is less than max_rows (60).
Showing all the 20 rows because this value is less than max_rows (60). | Screenshot: Andryw Marques

3. Set the Column Width Using pd.set_option(‘display.max_colwidth’, None)

You can change the width of the column with the option max_colwidth. For example, the “plot” column has many characters and the display was originally truncated:

Some text of the plot column is hidden.
Some text of the plot column is hidden. | Screenshot: Andryw Marques

You can increase the width by passing an int. Or put at the max passing None:

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

movies[['Title', 'Plot']].head()
The whole text of the plot column is being shown.
The whole text of the plot column is being shown. | Screenshot: Andryw Marques

4. Set the Sequence of Items Using pd.set_option(‘display.max_seq_items’, None)

The sequence of items (lists) will also be truncated if they have a lot of characters:

#Create "my_list" column and put a list of 100 values in each row
movies['my_list'] = [[1]*100] * 250 

movies.head()
Truncated sequence of items (lists.)
Truncated sequence of items (lists.) | Screenshot: Andryw Marques

The option to change this behavior is max_seq_items. But we also have to change the max_colwidth. If we change the max_colwidth, the lists will be truncated:

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

movies.head()
“My_list” column expanded but the lists are truncated.
“My_list” column expanded but the lists are truncated. | Screenshot: Andryw Marques

So, you’ll need to change the max_seq_item.

pd.set_option('display.max_seq_items', None)

movies.head()
Showing all the values of the lists.
Showing all the values of the lists. | Screenshot: Andryw Marques

More on Pandas: A Guide to Pandas Pivot Table

 

How to Change Precision of Numbers in Pandas DataFrame

Another useful option for displaying values in a DataFrame is to set the float precision, or the number of places after the decimal, by using the precision option.

#adding more decimal places to imdbRating column
movies['imdbRating'] = movies['imdbRating'] + 0.11111

movies[['imdbRating']].head()
Numbers with 5 decimal places.
Numbers with 5 decimal places. | Screenshot: Andryw Marques
pd.set_option('display.precision', 2)

movies[['imdbRating']].head()
Numbers with 2 decimal places.
Numbers with 2 decimal places. | Screenshot: Andryw Marques

Frequently Asked Questions

To show all columns and rows in a Pandas DataFrame, do the following: 

  1. Display all columns with: pd.set_option('display.max_columns', None)
  2. Display all rows with: pd.set_option('display.max_rows', None)
Explore Job Matches.