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
Name | Description | Type | Default |
---|---|---|---|
df (required) | The pandas DataFrame to display. | pd.DataFrame | None |
label | Text label displayed above the table. | str | None |
key | Identifier for the widget. | str | None |
actions | List of action configurations. | List[dict] | None |
full_width | Whether the table should take up the full width of its container. | bool | False |
display_index | Whether to display row indices. | bool | True |
filterable | Whether the table is filterable. | bool | True |
page_size | Number of rows to display per page. | int | 10 |
pagination_always_visible | Whether pagination controls are always visible. | bool | True |