Skip to main content
Version: Next

ts_shape.transform.functions.lambda_func

Classes
NameDescription
LambdaProcessorProvides class methods for applying lambda or callable functions to columns in a pandas DataFrame.

LambdaProcessor​

classsource

Bases: Base

Provides class methods for applying lambda or callable functions to columns in a pandas DataFrame. This class inherits from Base, ensuring consistency with other processors.

Functions
NameDescription
apply_functionApplies a lambda or callable function to a specified column in the DataFrame.

apply_function​

classmethodsource
apply_function(
dataframe: pd.DataFrame, value_column: str, func: Callable[[Any], Any]
) -> pd.DataFrame

Applies a lambda or callable function to a specified column in the DataFrame.

Parameters
NameTypeDescriptionDefault
dataframeDataFrameThe DataFrame containing the data.required
value_columnstrThe name of the column to apply the function to.required
funcCallableThe lambda function or callable to apply to the column.required
Returns
TypeDescription
DataFramepd.DataFrame: A copy of the DataFrame with the transformed column (the input frame is not modified).
Raises
TypeDescription
ColumnNotFoundErrorIf the column is missing.