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)disable_tbl_preview()
Remove the tbl_preview() display formatter and restore defaults.
Usage
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
Noneoutput, so nothing is printed in the cell.
Examples
With the preview formatter active, the DataFrame renders as a tbl_preview() table:
dfPandasRows3Columns2 | ||
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
- enable_tbl_preview(): Register tbl_preview() as the default DataFrame display formatter.
- tbl_preview(): Generate a preview table for a single DataFrame.