Count  type: count#

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

Counts non-nan values in each column of the DataFrame and returns a new DataFrame with a single row with a count for each original column, see pandas.DataFrame.count.

df.count(axis=<axis>, level=<level>, numeric_only=<numeric_only>).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.

numeric_only

type: bool
default: False
Include only float, int or boolean data.


Methods#

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

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