Sum  type: sum#

class lumen.transforms.base.Sum(*, axis, level, controls, name)#

Sums numeric values in each column of the DataFrame and returns a new DataFrame with a single row containing the sum for each original column, see pandas.DataFrame.sum.

df.count(axis=<axis>, level=<level>).to_frame().T


Parameters#

axis

type: int | str
default: 0
The axis to rename. 0 or ‘index’, 1 or ‘columns’

level

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


Methods#

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

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