shapelets.DataSet.sort_by#

DataSet.sort_by(cols: Union[str, int, List[Union[int, str]]], ascending: Optional[Union[bool, List[bool]]] = None) DataSet#

Sets a sorting criteria

Parameters:
cols: string, integer or a list of strings and/or integers

Selects which columns to sort by, either through name or ordinal position.

ascending: optional, boolean or list of booleans.

Determines if the order is ascending (True) or descending (False). When set, it should provide as many entries as in cols. When unset, if defaults to all ascending.

Examples

Ascending order

>>> df.sort_by('my_col')

Descending order

>>> df.sort_by('my_col',ascending=False)