If you are working with datasets containing a large number of columns, it can very well happen that only some of the columns are shown when displaying the dataframe or a section of it. In this tutorial, we’ll look at how to show all the columns of a pandas dataframe in a jupyter notebook.
If you prefer a video tutorial over text, check out the following video detailing the steps in this tutorial –
Default limit on columns to be shown
By default, a pandas dataframe displays a limited number of columns. You can check this with the following syntax:
import pandas as pd pd.get_option("display.max_columns")
Output:
20
Depending on your pandas version and settings, you may get a different number. In our case, the result turned out to be 20. That is, if a dataframe has more than 20 columns, it will skip a few columns when displaying the dataframe.
Let’s read the rain in Australia dataset in a jupyter notebook. We read the dataset from a CSV file saved locally. This is how the dataset looks if we display the first five rows in jupyter notebook.
df = pd.read_csv("weatherAUS.csv") df.head()
Output:

You can see that the dataset has 23 columns but some of these columns have been skipped (denoted by …) on display.
Introductory ⭐
- Harvard University Data Science: Learn R Basics for Data Science
- Standford University Data Science: Introduction to Machine Learning
- UC Davis Data Science: Learn SQL Basics for Data Science
- IBM Data Science: Professional Certificate in Data Science
- IBM Data Analysis: Professional Certificate in Data Analytics
- Google Data Analysis: Professional Certificate in Data Analytics
- IBM Data Science: Professional Certificate in Python Data Science
- IBM Data Engineering Fundamentals: Python Basics for Data Science
Intermediate ⭐⭐⭐
- Harvard University Learning Python for Data Science: Introduction to Data Science with Python
- Harvard University Computer Science Courses: Using Python for Research
- IBM Python Data Science: Visualizing Data with Python
- DeepLearning.AI Data Science and Machine Learning: Deep Learning Specialization
Advanced ⭐⭐⭐⭐⭐
- UC San Diego Data Science: Python for Data Science
- UC San Diego Data Science: Probability and Statistics in Data Science using Python
- Google Data Analysis: Professional Certificate in Advanced Data Analytics
- MIT Statistics and Data Science: Machine Learning with Python - from Linear Models to Deep Learning
- MIT Statistics and Data Science: MicroMasters® Program in Statistics and Data Science
🔎 Find Data Science Programs 👨💻 111,889 already enrolled
Disclaimer: Data Science Parichay is reader supported. When you purchase a course through a link on this site, we may earn a small commission at no additional cost to you. Earned commissions help support this website and its team of writers.
Display all the columns in Jupyter Notebook
To show all the columns of a pandas dataframe in jupyter notebook, you can change the pandas display settings. Let’s go ahead and set the max_columns
display parameter to None
so that all the columns are displayed. You can use the pandas set_option()
function to alter such configurations.
# settings to display all columns pd.set_option("display.max_columns", None) # display the dataframe head df.head()
Output:

You can see that now if we display the dataframe, all the columns are shown because we have updated the max column display settings.
Display more rows in Jupyter Notebook
You can also similarly change the display settings to show more rows when printing/displaying the dataframe. For example, to display all the rows of a pandas dataframe, set the max_rows
display option to None
. The following is the syntax:
pd.set_option("display.max_rows", None)
With this, we come to the end of this tutorial. The code examples and results presented in this tutorial have been implemented in a Jupyter Notebook with a python (version 3.8.3) kernel having pandas version 1.0.5
Subscribe to our newsletter for more informative guides and tutorials.
We do not spam and you can opt out any time.