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
Name | Description | Type |
---|---|---|
df | The pandas dataframe to be displayed | "DataFrame" |
display_index | Whether to show a index column. Defaults to False. | bool |
label | The label to display to the user | str |
initial_value | The initial value of the selection. Defaults to [] | list |
multiple | Whether the user will be allowed to select multiple rows. Defaults to False. | bool |
min | The minimal amount of options that should be selected. Defaults to None. | number |
max | The maximum amount of options that should be selected. Defaults to None. | number |
page_size | The number of rows to display per page. Defaults to 10. | number |
full_width | Whether the input should use full screen width. Defaults to True. | bool |
disabled | whether the input is disabled. Defaults to False. | bool |
required | Whether the input is required or not eg. "this field is required". Defaults to True. | Union[bool, str] |
hint | A tooltip displayed to the user. Defaults to None. | str |
button_text | What text to display on the button when the widget is not part of a Page. Defaults to 'Next'. | str |
Return Values
Type | Description |
---|---|
list | The list of selected rows |