Report.add_table

add_table

add_table(data: DataFrame | LazyFrame, *, title: str, caption: str | None = None, notes: str | None = None, id: str | None = None) -> ReportItem

Add an aggregated polars table to the current section.

Parameters:
  • data (DataFrame | LazyFrame) –

    Eager or lazy polars table to include.

  • title (str) –

    Visible table heading.

  • caption (str | None, default: None ) –

    Optional caption below the table.

  • notes (str | None, default: None ) –

    Optional explanatory notes.

  • id (str | None, default: None ) –

    Optional stable component ID.

Returns:
Raises:
  • ValueError –

    If the table exceeds the configured row limit.

Example

table = ps.stats.frequency(df, 'enctype')
report.add_table(table, title='Encounter types')

Research note

Custom tables are not automatically de-identified. Review small cells and identifiers before sharing.

← Reports API