tensortrade.pipeline.transformers.lambda_transformer module

class tensortrade.pipeline.transformers.lambda_transformer.LambdaTransformer(func: Callable[[DataFrame], DataFrame])[source]

Bases: AbstractTransformer

Initializes the LambdaTransformer. This allows you to custom transform data without writing a class.

Parameters:

func – A callable that takes a DataFrame and returns a transformed DataFrame.

transform(df: DataFrame) DataFrame[source]

Applies the lambda function to the DataFrame.

Parameters:

df (DataFrame) – The input DataFrame.

Returns:

The transformed DataFrame.

Return type:

DataFrame