ts_shape.transform.functions.lambda_func
¤
Classes:
-
LambdaProcessor
–Provides class methods for applying lambda or callable functions to columns in a pandas DataFrame.
LambdaProcessor
¤
LambdaProcessor(dataframe: DataFrame, column_name: 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.
Parameters:
-
dataframe
¤DataFrame
) –The DataFrame to be processed.
-
column_name
¤str
, default:'systime'
) –The column to sort by. Default is 'systime'. If the column is not found or is not a time column, the class will attempt to detect other time columns.
Methods:
-
apply_function
–Applies a lambda or callable function to a specified column in the DataFrame.
-
get_dataframe
–Returns the processed DataFrame.
Source code in src/ts_shape/utils/base.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
apply_function
classmethod
¤
Applies a lambda or callable function to a specified column in the DataFrame.
Parameters:
-
dataframe
¤DataFrame
) –The DataFrame containing the data.
-
column_name
¤str
) –The name of the column to apply the function to.
-
func
¤Callable
) –The lambda function or callable to apply to the column.
Returns:
-
DataFrame
–pd.DataFrame: The DataFrame with the transformed column.
Source code in src/ts_shape/transform/functions/lambda_func.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
get_dataframe
¤
get_dataframe() -> DataFrame
Returns the processed DataFrame.
Source code in src/ts_shape/utils/base.py
34 35 36 |
|