From c1c17bc59d1ecfe703dbaf67fc69102786d794ef Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 25 Jul 2023 14:40:45 -0500 Subject: [PATCH] bug fix: random shuffle --- data/maker/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 8327eea..28d224c 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -559,7 +559,7 @@ class Shuffle(Generator): def run(self): - np.random.seed(1) + self.initalize() # @@ -589,10 +589,12 @@ class Shuffle(Generator): for _columns in _invColumns : _tmpdf = self._df[_columns].copy()[_columns] + np.random.seed(1) np.random.shuffle(_index) - - _tmpdf = _tmpdf.iloc[_index] - + print (_columns,_index) + # _values = _tmpdf.values[_index] + #_tmpdf = _tmpdf.iloc[_index] + _tmpdf = pd.DataFrame(_tmpdf.values[_index],columns=_columns) if _xdf.shape[0] == 0 : _xdf = _tmpdf else: