Stack  type: stack#

class lumen.transforms.base.Stack(*, dropna, level, controls, name)#

Stack applies pandas.DataFrame.stack to the declared level.

df.stack(<level>)


Parameters#

dropna

type: bool
default: True
Whether to drop rows in the resulting Frame/Series with missing values.Stacking a column level onto the index axis can create combinations ofindex and column values that are missing from the originaldataframe.

level

type: int | list | str
default: -1
The indexes to stack.


Methods#

Stack.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

Stack.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