disable_tbl_preview()

Remove the tbl_preview() display formatter and restore defaults.

Usage

Source

disable_tbl_preview()

After calling this, any Polars or Pandas DataFrame will revert to using the library’s default HTML representation instead of tbl_preview(). This undoes the effect of enable_tbl_preview().

Returns

None
The formatter is removed as a side effect. IPython suppresses None output, so nothing is printed in the cell.

Examples

import pandas as pd
import great_docs as gd

df = pd.DataFrame({"name": ["Alice", "Bob", "Carol"], "score": [92, 87, 95]})
gd.enable_tbl_preview(n_head=3)

With the preview formatter active, the DataFrame renders as a tbl_preview() table:

df
PandasRows3Columns2
name
str
score
i64
0 Alice 92
1 Bob 87
2 Carol 95

After disabling, the DataFrame reverts to the default Pandas HTML:

gd.disable_tbl_preview()
df
name score
0 Alice 92
1 Bob 87
2 Carol 95

From this point on, all DataFrames (Pandas, Polars, or otherwise) will render using their native styling until enable_tbl_preview() is called again.

See Also