bug fix: random shuffle

This commit is contained in:
Steve Nyemba 2023-07-25 14:40:45 -05:00
parent b9596edd8e
commit c1c17bc59d
1 changed files with 6 additions and 4 deletions

View File

@ -559,7 +559,7 @@ class Shuffle(Generator):
def run(self): def run(self):
np.random.seed(1)
self.initalize() self.initalize()
# #
@ -589,10 +589,12 @@ class Shuffle(Generator):
for _columns in _invColumns : for _columns in _invColumns :
_tmpdf = self._df[_columns].copy()[_columns] _tmpdf = self._df[_columns].copy()[_columns]
np.random.seed(1)
np.random.shuffle(_index) np.random.shuffle(_index)
print (_columns,_index)
_tmpdf = _tmpdf.iloc[_index] # _values = _tmpdf.values[_index]
#_tmpdf = _tmpdf.iloc[_index]
_tmpdf = pd.DataFrame(_tmpdf.values[_index],columns=_columns)
if _xdf.shape[0] == 0 : if _xdf.shape[0] == 0 :
_xdf = _tmpdf _xdf = _tmpdf
else: else: