Skip to content
Advertisement

How to show all columns’ names on a large pandas dataframe?

I have a dataframe that consist of hundreds of columns, and I need to see all column names.

What I did:

JavaScript

The output is:

JavaScript

How do I show all columns, instead of a truncated list?

Advertisement

Answer

You can globally set printing options. I think this should work:

Method 1:

JavaScript

Method 2:

JavaScript

This will allow you to see all column names & rows when you are doing .head(). None of the column name will be truncated.


If you just want to see the column names you can do:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement