How to Show all Column Names in Large Pandas Dataframe?

Spread the love

Problem –

You have a large pandas dataframe and want to see all the column names.

Solution –

To see all the column names, you can globally set the printing options like this –

import pandas as pd

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

Or you can use

import pandas as pd

pd.options.display.max_columns = None
pd.options.display.max_rows = None

This will help you see all of the column names when you use df.head() method.

Rating: 1 out of 5.

Leave a Reply