Sort  type: sort#

class lumen.transforms.base.Sort(*, ascending, by, controls, name)#

Sort on one or more columns, see pandas.DataFrame.sort_values.

df.sort_values(<by>, ascending=<ascending>)


Parameters#

ascending

type: bool | list
default: True
Sort ascending vs. descending. Specify list for multiple sortorders. If this is a list of bools, must match the length ofthe by.

by

type: Any
default: []
Possible values: ``
Columns or indexes to sort by.


Methods#

Sort.apply(table: DataFrame) DataFrame#

Given a table transform it in some way and return it.

Parameters:

table (DataFrame) – The queried table as a DataFrame.

Returns:

A DataFrame containing the transformed data.

Return type:

DataFrame

Sort.to_spec(context: Dict[str, Any] | None = None) Dict[str, Any]#

Exports the full specification to reconstruct this component.

Return type:

Resolved and instantiated Component object