|
|
|
@ -341,15 +341,20 @@ class Shuffle(Generator):
|
|
|
|
|
super().__init__(**_args)
|
|
|
|
|
def run(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
np.random.seed(1)
|
|
|
|
|
self.initalize()
|
|
|
|
|
_index = np.arange(self._df.shape[0])
|
|
|
|
|
np.random.shuffle(_index)
|
|
|
|
|
np.random.shuffle(_index)
|
|
|
|
|
_iocolumns = self.info['columns']
|
|
|
|
|
_ocolumns = list(set(self._df.columns) - set(_iocolumns) )
|
|
|
|
|
# _iodf = pd.DataFrame(self._df[_ocolumns],self._df.loc[_index][_iocolumns],index=np.arange(_index.size))
|
|
|
|
|
_iodf = pd.DataFrame(self._df[_iocolumns],index = np.arange(_index.size))
|
|
|
|
|
self._df = self._df[_ocolumns].join(_iodf)
|
|
|
|
|
_iodf = pd.DataFrame(self._df[_iocolumns].copy(),index = np.arange(_index.size))
|
|
|
|
|
# self._df = self._df.loc[_index][_ocolumns].join(_iodf)
|
|
|
|
|
self._df = self._df.loc[_index][_ocolumns]
|
|
|
|
|
self._df.index = np.arange(self._df.shape[0])
|
|
|
|
|
self._df = self._df.join(_iodf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_log = {'action':'io-data','input':{'candidates':1,'rows':int(self._df.shape[0])}}
|
|
|
|
|