When working with large datasets in Python, encountering a pandas DataFrame that only displays an ellipsis or a truncated preview is a common frustration. This default behavior is designed to keep your console readable, but it often gets in the way when you need to verify the complete contents of your data. This guide provides a thorough walkthrough of the methods available to print all values in a pandas DataFrame, ensuring you have full visibility into your data at any time.
Understanding Pandas Display Options
The key to solving this issue lies in understanding pandas' global display options. These settings act as a configuration manager for how DataFrames are rendered in the console or a notebook. By adjusting specific parameters, you can override the standard truncation rules. Before diving into the specific commands, it is important to grasp the mechanics behind the truncation, which is primarily controlled by the display.max_rows and display.max_columns settings.
Setting the Global Threshold to None
The most direct approach to disable truncation entirely is to set the display.max_rows and display.max_columns options to None. This tells pandas to remove any upper limit on the number of rows and columns it displays. While this is highly effective for small to medium-sized datasets, it is generally not recommended for very large DataFrames, as attempting to print millions of rows can crash your kernel or make specific data points impossible to locate.

Implementing the Max Options
To apply this method, you will use the pd.set_option() function. You need to specify the specific option you want to change and assign it the new value. The following code snippet demonstrates how to configure your environment to show every row and column without restriction.
| Option Parameter | Value | Description |
|---|---|---|
| display.max_rows | None | Removes the limit on the number of rows displayed. |
| display.max_columns | None | Removes the limit on the number of columns displayed. |
The Context Manager for Temporary Changes
While changing global settings is effective, it can alter the behavior of your entire session, which might not be ideal if you are running multiple scripts with different display requirements. A more elegant and safe solution is to use the pd.option_context() method. This works as a context manager, applying your preferred display rules only within a specific block of code. Once the block is exited, the settings automatically revert to their previous state, preventing any side effects on subsequent operations.
Code Structure for Contextual Display
Using this method ensures that your environment remains clean and predictable. You define the desired options within the with statement, and any DataFrame printed inside that block will adhere to those rules. This is particularly useful during interactive debugging or when generating specific reports where full data visibility is required temporarily.

Adjusting Width for Horizontal Completeness
Even if you manage the row and column counts, you might still encounter issues where long strings or numerous columns cause the output to wrap awkwardly in your terminal. This wrapping breaks the row structure, making the data difficult to read. To combat this, you need to adjust the display.width and display.max_colwidth parameters. Setting a large width ensures that rows stay on a single line, while increasing the max column width ensures that text entries are not truncated with ellipses.
Retrieving Values as a NumPy Array
If your goal is not just to view the data but to process it further or print it in a custom format, converting the DataFrame to a NumPy array can be a robust alternative. By accessing the underlying values, you bypass the pandas rendering engine entirely. This method guarantees that every single element is captured, though it returns the raw data without the index and column labels, which is something to consider depending on your use case.
Iterating for Custom Output
For ultimate control over the presentation, iterating through the DataFrame allows you to print the contents exactly as you desire. This approach is more verbose but offers flexibility if you need to format the output in a specific way, such as adding custom separators or handling missing values differently. Looping through the rows or using the itertuples() method provides a granular level of access that is impossible to achieve with a simple print command.























