Skip to main content

PandasOutput

Pandas DataFrame output widget for displaying tabular data.

Examples

Basic Usage

This example runs a form with a single page containing the widget

Example Code

import pandas as pd

from abstra.forms import PandasOutput, run

data = [
{"Country": "USA", "Population": "32,700,000"},
{"Country": "China", "Population": "1,300,000,000"},
{"Country": "Japan", "Population": "126,000,000"},
]
df = pd.DataFrame(data)

# Create a page with the widget
example_page = [
PandasOutput(df=df),
]

# Run the form
result = run([example_page])

# Print the result
print(result)

Parameters

NameDescriptionTypeDefault
df (required)The pandas DataFrame to display.pd.DataFrameNone
labelText label displayed above the table.strNone
keyIdentifier for the widget.strNone
actionsList of action configurations.List[dict]None
full_widthWhether the table should take up the full width of its container.boolFalse
display_indexWhether to display row indices.boolTrue
filterableWhether the table is filterable.boolTrue
page_sizeNumber of rows to display per page.int10
pagination_always_visibleWhether pagination controls are always visible.boolTrue