Rename  type: rename#

class lumen.transforms.base.Rename(*, axis, columns, copy, index, level, mapper, controls, name)#

Rename renames columns or indexes, see pandas.DataFrame.rename.

df.rename(mapper=<mapper>, columns=<columns>, index=<index>,

level=<level>, axis=<axis>, copy=<copy>)


Parameters#

axis

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

columns

type: dict
default: None
Alternative to specifying axis (mapper, axis=1 is equivalent tocolumns=mapper).

copy

type: bool
default: False
Also copy underlying data.

index

type: dict
default: None
Alternative to specifying axis (mapper, axis=0 is equivalent toindex=mapper).

level

type: int | str
default: None
In case of a MultiIndex, only rename labels in the specified level.

mapper

type: dict
default: None
Dict to apply to that axis’ values. Use either mapper and axis tospecify the axis to target with mapper, or index and columns.


Methods#

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

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