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