How to Display All Columns in a Pandas DataFrame

If you work with large datasets in Python, you’ve likely run into the “annoying dots” problem. By default, Pandas truncates your view when you have a lot of columns, showing only the first and last few.

I remember the first time I was analyzing a US Census dataset with over 50 variables. I needed to see every single column to understand the schema, but Pandas kept hiding them.

It can be incredibly frustrating when you are trying to spot data inconsistencies or verify a complex merge.

In this tutorial, I will show you several ways to force Pandas to display every single column in your DataFrame.

The Default Truncation Problem in Pandas

Pandas is designed to keep your console or Jupyter Notebook clean. Because of this, it uses a threshold to decide when to hide columns.

When your DataFrame exceeds this threshold, you get an ellipsis (…) in the middle of your output.

While this is great for performance, it’s not helpful when you are in the middle of exploratory data analysis (EDA).

I’ve found that the best way to handle this depends on whether you want a temporary fix or a permanent setting for your entire session.

Method 1: Use pd.set_option to Change Display Settings

This is my go-to method when I am starting a new project. It allows you to change the behavior of Pandas globally for your current script.

By setting the display.max_columns option to None, you tell Pandas that there is no limit to how many columns it should show.

Here is the code I use when I want to see everything:

import pandas as pd

# Sample data representing US Real Estate listings
data = {
    'Property_ID': [101, 102],
    'State': ['NY', 'CA'],
    'City': ['New York', 'Los Angeles'],
    'Zip_Code': ['10001', '90001'],
    'Price': [850000, 1200000],
    'Bedrooms': [2, 3],
    'Bathrooms': [2, 2.5],
    'Square_Feet': [1200, 1800],
    'Year_Built': [1920, 2015],
    'Lot_Size': [0.1, 0.2],
    'Has_Garage': [False, True],
    'Has_Pool': [False, True],
    'Neighborhood': ['Manhattan', 'Santa Monica'],
    'Tax_Rate': [1.2, 1.1],
    'Last_Sold_Date': ['2018-05-12', '2021-11-30']
}

df = pd.DataFrame(data)

# Set Pandas to display all columns
pd.set_option('display.max_columns', None)

# Now when you print, every column appears
print(df)

You can refer to the screenshot below to see the output.

Display All Columns in a Pandas DataFrame

In the code above, I used a dictionary of US real estate data. Without the set_option line, most of those columns would be hidden.

I prefer using None because it’s easier to remember than a specific high number like 999.

Method 2: Use the option_context Manager (Temporary Fix)

Sometimes, I don’t want to change the settings for the whole notebook. I might only want to see all columns for one specific DataFrame printout.

In these cases, I use a context manager. This ensures the “display all” rule only applies to the code inside the with block.

This keeps my other outputs clean and manageable.

import pandas as pd

# Data representing US Tech Employee Salaries
salary_data = {
    'Employee_ID': range(1, 4),
    'Company': ['Google', 'Meta', 'Amazon'],
    'Role': ['Software Engineer', 'Data Scientist', 'Product Manager'],
    'Base_Salary': [150000, 165000, 145000],
    'Stock_Options': [50000, 80000, 40000],
    'Annual_Bonus': [15000, 20000, 12000],
    'Location': ['Mountain View, CA', 'Menlo Park, CA', 'Seattle, WA'],
    'Remote_Friendly': [True, False, True],
    'Health_Insurance': ['Premium', 'Standard', 'Premium'],
    'Retirement_Plan_401k': ['Matching 6%', 'Matching 4%', 'Matching 5%']
}

df_salaries = pd.DataFrame(salary_data)

# Temporarily show all columns for this specific block
with pd.option_context('display.max_columns', None):
    print("Full Employee Data:")
    print(df_salaries)

# Outside the block, the default truncation returns
print("\nBack to normal view:")
print(df_salaries)

You can refer to the screenshot below to see the output.

How to Display All Columns in Pandas DataFrame

I find this method very professional when writing shared scripts. It doesn’t mess up the environment for other developers who might use your code.

Method 3: Convert the DataFrame to a String

Another trick I’ve used over the years is the to_string() method.

When you call print(df.to_string()), Pandas generates a full string representation of the data without applying any truncation rules.

It’s quick, dirty, and works every time.

import pandas as pd

# US Automotive Sales Data
car_data = {
    'Model_Year': [2023, 2024, 2023],
    'Make': ['Ford', 'Tesla', 'Chevrolet'],
    'Model': ['F-150', 'Model 3', 'Silverado'],
    'Engine_Type': ['V6', 'Electric', 'V8'],
    'Transmission': ['Automatic', 'Single-speed', 'Automatic'],
    'Drivetrain': ['4WD', 'AWD', 'RWD'],
    'MSRP': [45000, 38990, 48000],
    'Safety_Rating': [5, 5, 4],
    'Fuel_Efficiency_City': [19, 132, 16],
    'Fuel_Efficiency_Hwy': [24, 124, 21],
    'Warranty_Years': [3, 4, 3]
}

df_cars = pd.DataFrame(car_data)

# Print everything without changing global options
print(df_cars.to_string())

You can refer to the screenshot below to see the output.

Print All Columns in Pandas DataFrame

One thing to watch out for: if your DataFrame has thousands of rows, to_string() will print every single row too.

Usually, I combine this with .head() to see all columns but only a few rows.

Method 4: Transpose the DataFrame

If I have an extreme number of columns, say 50 or 100, printing them horizontally is still hard to read.

In these scenarios, I often transpose the DataFrame. This turns my columns into rows.

It’s a great way to “audit” your data structure at a glance.

import pandas as pd

# US Healthcare Statistics Sample
health_data = {
    'Metric_ID': ['M-01', 'M-02'],
    'State_Name': ['Texas', 'Florida'],
    'Population': [29145505, 21538187],
    'Life_Expectancy': [78.4, 79.2],
    'Uninsured_Rate': [0.18, 0.13],
    'Hospitals_Count': [600, 300],
    'Avg_Wait_Time': [24, 28],
    'Healthcare_Score': [72, 75],
    'Rural_Access_Index': [0.65, 0.72]
}

df_health = pd.DataFrame(health_data)

# Transpose the view: columns become the index
print(df_health.head().T)

By using .T, you can scroll vertically to see all your column names and the first few values. I use this daily during data cleaning.

Method 5: Use the Get Option to Check Current Status

Sometimes you might wonder why your columns are hiding or what the current limit is.

You can use pd.get_option to check the current configuration of your environment.

import pandas as pd

# Check how many columns Pandas is currently allowed to show
current_max = pd.get_option('display.max_columns')

print(f"Current Pandas column limit is: {current_max}")

This is helpful if you are working in a corporate environment where a startup script might have pre-configured your Pandas settings.

Deal with Column Width (Truncated Text)

Even if you show all columns, sometimes the text inside the column gets cut off (e.g., a long US address).

To fix this, I also adjust the display.max_colwidth.

# Set max column width to None so no text is cut off
pd.set_option('display.max_colwidth', None)

I usually pair this with the max_columns setting to get a truly “unfiltered” view of my data.

Important Considerations for Memory

While it is tempting to always show all columns, be careful with very large datasets.

Rendering a massive table in a browser (like Jupyter) or a terminal can sometimes cause the application to lag.

I always recommend using .head(10) along with these display settings to keep things snappy.

If you are working with thousands of columns, consider selecting only the columns you need for the specific task at hand.

In my experience, showing 20-30 columns is helpful, but showing 500 columns is often counterproductive.

Displaying all columns in Pandas is a simple task once you know the right configuration settings.

Whether you use pd.set_option for a global change or to_string() for a quick check, these methods will save you a lot of time during data analysis.

You may also like to read other related tutorials:

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.