bug fix with shuffler

dev
Steve Nyemba 3 years ago
parent 5d4c534fae
commit 4aacb74f29

@ -341,15 +341,20 @@ 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])}}

@ -4,7 +4,7 @@ import sys
def read(fname): def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
args = {"name":"data-maker","version":"1.5.2", args = {"name":"data-maker","version":"1.5.3",
"author":"Vanderbilt University Medical Center","author_email":"steve.l.nyemba@vumc.org","license":"MIT", "author":"Vanderbilt University Medical Center","author_email":"steve.l.nyemba@vumc.org","license":"MIT",
"packages":find_packages(),"keywords":["healthcare","data","transport","protocol"]} "packages":find_packages(),"keywords":["healthcare","data","transport","protocol"]}
args["install_requires"] = ['data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git','tensorflow'] args["install_requires"] = ['data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git','tensorflow']

Loading…
Cancel
Save