Skip to content

lambda_func

lambda_func ¤

LambdaProcessor ¤

LambdaProcessor(
    dataframe: DataFrame, time_column: str = "systime"
)

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.

apply_function classmethod ¤

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

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

Parameters:

Name Type Description Default
dataframe DataFrame

The DataFrame containing the data.

required
value_column str

The name of the column to apply the function to.

required
func Callable

The lambda function or callable to apply to the column.

required

Returns:

Type Description
DataFrame

pd.DataFrame: A copy of the DataFrame with the transformed column (the input frame is not modified).

Raises:

Type Description
ColumnNotFoundError

If the column is missing.