Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Options for the pandas Package in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Max Number of Columns to Display

Max Number of Rows to Display

Max Column Width to Display

You can control the max column width of pandas display using the option pd.options.display.max_colwidth .

Set pd.options.display.max_colwidth to a specific limit.

Set pd.options.display.max_colwidth to None which imposes no limit.

Loading...
Loading...

Display Formatting of Floating Numbers

Loading...
a int64 b int64 dtype: object
Loading...
['chop_threshold', 'colheader_justify', 'column_space', 'date_dayfirst', 'date_yearfirst', 'encoding', 'expand_frame_repr', 'float_format', 'height', 'html', 'large_repr', 'latex', 'line_width', 'max_categories', 'max_columns', 'max_colwidth', 'max_info_columns', 'max_info_rows', 'max_rows', 'max_seq_items', 'memory_usage', 'multi_sparse', 'notebook_repr_html', 'pprint_nest_depth', 'precision', 'show_dimensions', 'unicode', 'width']

Styling

  1. Avoid applying styling on large pandas DataFrames, as pandas styling (using DataFrame.style.format) is extremely slow on large data frames. It is suggested that you always use DataFrame.head, DataFrame.tail or filtering to limit the size of a DataFrame before applying styling to it. Another good way is to display a pandas DataFrame using a widget extension. For more details, please refer to JupyterLab Extensions for Spreadsheet.