Skip to main content

__ Back to top

__ ` Ctrl ` \+ ` K `

[ ![pandas 2.2.1 documentation - Home](../_static/pandas.svg) ](../index.html)

Site Navigation

  * [ Getting started ](../getting_started/index.html)
  * [ User Guide ](index.html)
  * [ API reference ](../reference/index.html)
  * [ Development ](../development/index.html)
  * [ Release notes ](../whatsnew/index.html)

  * [ __ GitHub  ](https://github.com/pandas-dev/pandas "GitHub")
  * [ __ Twitter  ](https://twitter.com/pandas_dev "Twitter")
  * [ __ Mastodon  ](https://fosstodon.org/@pandas_dev "Mastodon")

Site Navigation

  * [ Getting started ](../getting_started/index.html)
  * [ User Guide ](index.html)
  * [ API reference ](../reference/index.html)
  * [ Development ](../development/index.html)
  * [ Release notes ](../whatsnew/index.html)

  * [ __ GitHub  ](https://github.com/pandas-dev/pandas "GitHub")
  * [ __ Twitter  ](https://twitter.com/pandas_dev "Twitter")
  * [ __ Mastodon  ](https://fosstodon.org/@pandas_dev "Mastodon")

  * [ 10 minutes to pandas ](10min.html)
  * [ Intro to data structures ](dsintro.html)
  * [ Essential basic functionality ](basics.html)
  * [ IO tools (text, CSV, HDF5, â¦) ](io.html)
  * [ PyArrow Functionality ](pyarrow.html)
  * [ Indexing and selecting data ](indexing.html)
  * [ MultiIndex / advanced indexing ](advanced.html)
  * [ Copy-on-Write (CoW) ](copy_on_write.html)
  * [ Merge, join, concatenate and compare ](merging.html)
  * [ Reshaping and pivot tables ](reshaping.html)
  * [ Working with text data ](text.html)
  * [ Working with missing data ](missing_data.html)
  * [ Duplicate Labels ](duplicates.html)
  * [ Categorical data ](categorical.html)
  * [ Nullable integer data type ](integer_na.html)
  * [ Nullable Boolean data type ](boolean.html)
  * [ Chart visualization ](visualization.html)
  * Table Visualization 
  * [ Group by: split-apply-combine ](groupby.html)
  * [ Windowing operations ](window.html)
  * [ Time series / date functionality ](timeseries.html)
  * [ Time deltas ](timedeltas.html)
  * [ Options and settings ](options.html)
  * [ Enhancing performance ](enhancingperf.html)
  * [ Scaling to large datasets ](scale.html)
  * [ Sparse data structures ](sparse.html)
  * [ Frequently Asked Questions (FAQ) ](gotchas.html)
  * [ Cookbook ](cookbook.html)

  * [ __ ](../index.html)
  * [ User Guide ](index.html)
  * Table Visualization 

#  Table Visualization  #

This section demonstrates visualization of tabular data using the [ Styler
](../reference/api/pandas.io.formats.style.Styler.html) class. For information
on visualization with charting please see [ Chart Visualization
](visualization.html) . This document is written as a Jupyter Notebook, and
can be viewed or downloaded [ here ](https://nbviewer.org/github/pandas-
dev/pandas/blob/main/doc/source/user_guide/style.ipynb) .

##  Styler Object and Customising the Display  #

Styling and output display customisation should be performed **after** the
data in a DataFrame has been processed. The Styler is **not** dynamically
updated if further changes to the DataFrame are made. The ` DataFrame.style  `
attribute is a property that returns a [ Styler
](../reference/api/pandas.io.formats.style.Styler.html) object. It has a `
_repr_html_  ` method defined on it so it is rendered automatically in Jupyter
Notebook.

The Styler, which can be used for large data but is primarily designed for
small data, currently has the ability to output to these formats:

  * HTML 

  * LaTeX 

  * String (and CSV by extension) 

  * Excel 

  * (JSON is not currently available) 

The first three of these have display customisation methods designed to format
and customise the output. These include:

  * Formatting values, the index and columns headers, using [ .format()  ](../reference/api/pandas.io.formats.style.Styler.format.html) and [ .format_index()  ](../reference/api/pandas.io.formats.style.Styler.format_index.html) , 

  * Renaming the index or column heade