Skip to main content

Selectable Table

Enables selection of rows from a displayed pandas DataFrame table.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_pandas

import pandas as pd
from abstra.forms import read_pandas_row_selection

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

Parameters

NameDescriptionType
dfThe pandas dataframe to be displayed"DataFrame"
display_indexWhether to show a index column. Defaults to False.bool
labelThe label to display to the userstr
initial_valueThe initial value of the selection. Defaults to []list
multipleWhether the user will be allowed to select multiple rows. Defaults to False.bool
minThe minimal amount of options that should be selected. Defaults to None.number
maxThe maximum amount of options that should be selected. Defaults to None.number
page_sizeThe number of rows to display per page. Defaults to 10.number
full_widthWhether the input should use full screen width. Defaults to True.bool
disabledwhether the input is disabled. Defaults to False.bool
requiredWhether the input is required or not eg. "this field is required". Defaults to True.Union[bool, str]
hintA tooltip displayed to the user. Defaults to None.str
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str

Return Values

TypeDescription
listThe list of selected rows