From 9d2cfe085805298522a45a2d92c3e677b2cf3b4f Mon Sep 17 00:00:00 2001 From: Siegfried Eckstedt Date: Tue, 18 Jul 2023 13:29:37 +0200 Subject: [PATCH 1/2] Update generate method in white_noise.py module I faced issues to set feature specific white noise. The package resulted in a Key Error for the column "noise_1". The fix was to clear typos in column naming and fixing .drop method. --- timeseries_generator/white_noise.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timeseries_generator/white_noise.py b/timeseries_generator/white_noise.py index b2c6a0c..31bf098 100644 --- a/timeseries_generator/white_noise.py +++ b/timeseries_generator/white_noise.py @@ -102,7 +102,7 @@ def generate(self, start_date: Timestamp, end_date: Timestamp = None) -> DataFra feature: str = iter( self._feature_values ).__next__() # len(self._features is always 1) - factor_df["noise_1"] = randn(len(factor_df)) + factor_df["noise1"] = randn(len(factor_df)) def get_factor_col(row): stdev_factor: float = self._feature_values[feature][row[feature]] @@ -110,7 +110,7 @@ def get_factor_col(row): factor_df[self._col_name] = factor_df.apply( get_factor_col, axis=1 - ).drop("noise1", axis=1) + ).drop(columns=["noise_1"]) else: factor_df[self._col_name] = ( self._stdev_factor * randn(len(factor_df)) + 1 From 863413392989d2b740d6ea7227886fa8d6d4653c Mon Sep 17 00:00:00 2001 From: Siegfried Eckstedt Date: Tue, 18 Jul 2023 13:31:59 +0200 Subject: [PATCH 2/2] Update generate method in white_noise.py module Clearing typo in column naming. --- timeseries_generator/white_noise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timeseries_generator/white_noise.py b/timeseries_generator/white_noise.py index 31bf098..1892f87 100644 --- a/timeseries_generator/white_noise.py +++ b/timeseries_generator/white_noise.py @@ -110,7 +110,7 @@ def get_factor_col(row): factor_df[self._col_name] = factor_df.apply( get_factor_col, axis=1 - ).drop(columns=["noise_1"]) + ).drop(columns=["noise1"]) else: factor_df[self._col_name] = ( self._stdev_factor * randn(len(factor_df)) + 1