show_table()
Show a table in a Quarto page or Jupyter notebook, as knitr::kable() does in R.
The result is a Markdown pipe table. Quarto makes it a real table in HTML, PDF, and
Word, styled like the page, so it stays small in a page with embed-resources.
Jupyter, VS Code, and Positron show it as a table, and print() shows its Markdown.
Numeric columns are right-aligned and others left-aligned. Every row is shown, so
summarize first.
Usage
show_table(
data: Any,
caption: str | None = None,
digits: int | None = None,
big_mark: str = '',
na: str = '',
index: bool = False,
) -> TableDisplay
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| data required | Any |
A pandas or polars DataFrame or Series, or a numpy array. |
|
| caption | str | None | None |
A caption below the table. In Quarto, |
| digits | int | None | None |
Decimal places for floating-point numbers, kept even when they are zero ( |
| big_mark | str | '' |
The thousands separator for numbers, such as |
| na | str | '' |
What a missing value shows. Default: an empty cell. |
| index | bool | False |
Show the DataFrame's index as the first column. |
Value
A TableDisplay, which a notebook shows as the table when it is the last line
of a cell. Call IPython.display.display() on it to show it from elsewhere.
Raises
FrameworkError: Whendatais not table-like, ordigitsis negative.