ts_shape.transform.functions.lambda_func
Classes
| Name | Description |
|---|---|
LambdaProcessor | Provides class methods for applying lambda or callable functions to columns in a pandas DataFrame. |
LambdaProcessor
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
| Name | Description |
|---|---|
apply_function | Applies a lambda or callable function to a specified column in the DataFrame. |
apply_function
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
| 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. |