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

from abstra.forms import read_pandas_row_selection
import pandas as pd

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 displayedPandasDataFrame
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
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
end_programWhether the program should end after the widget is shown. Defaults to False.bool
full_widthWhether the input should use full screen width. Defaults to False.bool
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