shapelets.apps.DataApp.table#

DataApp.table(data: Union[DataFrame, DataSet] = None, title: Optional[str] = None, rows_per_page: Optional[int] = None, tools_visible: Optional[bool] = True, conditional_formats: Optional[List[Union[Condition, dict]]] = None, date_format: Optional[str] = None, **additional) TableWidget#

Displays rows of data.

Parameters:
dataDataset or pd.Dataframe, optional

Data to be included in the Table.

titlestr, optional
String with the Table title. It will be placed on top of the Table.
rows_per_pageint, optional

number of rows per page to show

tools_visiblebool, optional. Default True

show/hide header, header bold and rowcolumn controls and pagination

conditional_formats: List[Dict, Conditional], optional
Add format to a value applying any condition. There are two types of conditional format:
  • Range: Allow to modify the color and background color of a numeric value

  • Case: Allow to modify the color and background color of a string value

For example:
>>> myformat = {
>>>     "column": "T1",
>>>     "type": "range",
>>>     "conditions": [
>>>         { "min": 0, "max": 20, "backcolor": "#ff0000", "color": "#ffffff" },
>>>         { "min": 20,"max": 40, "backcolor": "#ff860a" },
>>>         { "min": 40,"max": 42, "color": "#ff860a" },
>>>         { "min": 44,"max": 100, "backcolor": "#00aa00" }
>>>     ]
>>> },
>>> {
>>>     "column": "Estado",
>>>     "type": "case",
>>>     "conditions": [
>>>         { "value": "Peligro", "backcolor": "#ff0000", "color": "#ffffff" },
>>>         { "value": "PrecauciĆ³n", "backcolor": "#000077", "color": "#ffffff" },
>>>         { "value": "OK", "backcolor": "#00aa00", "color": "#ffffff" }
>>>     ]
>>> }
>>> table = app.table(data=data,conditional_format=my_format)
date_format: str, Optional

If a column has a type timestamp, a format could be provided to transform the date.

Returns:
Table

Examples

>>> table1 = app.table(df)

Bind compatibility

You can bind this widget with this:

  • Shapelets Dataset

  • Pandas DataFrame

  • list

  • table()

Bindable as

You can bind this widget as:

Currently this widget cannot be used as input in a binding function.