From a0a2d8ae568ee1c8a70381b78608ac44f38b2a11 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Fri, 28 Jul 2023 12:40:51 -0500 Subject: [PATCH 1/2] bug fix: version update --- data/maker/__init__.py | 4 +++- data/maker/version.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 074d507..792f18e 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -187,6 +187,8 @@ class Learner(Process): no_value = 0 if np.sum(no_value) > 0 else '' try: self._df[name] = self._df[name].fillna(no_value) + except Exception as e: + print (['.... skipping ',name,no_value]) finally: pass @@ -591,7 +593,7 @@ class Shuffle(Generator): _tmpdf = self._df[_columns].copy()[_columns] np.random.seed(1) np.random.shuffle(_index) - print (_columns,_index) + # _values = _tmpdf.values[_index] #_tmpdf = _tmpdf.iloc[_index] _tmpdf = pd.DataFrame(_tmpdf.values[_index],columns=_columns) diff --git a/data/maker/version.py b/data/maker/version.py index c1d2f09..625b565 100644 --- a/data/maker/version.py +++ b/data/maker/version.py @@ -1 +1 @@ -__version__='1.7.2' +__version__='1.7.4' From 8e997675f8bad9321fb5cfa84f7299ae2b3d9746 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 8 Aug 2023 09:30:28 -0500 Subject: [PATCH 2/2] bug fix with data-frame --- data/maker/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 792f18e..3d3788a 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -182,8 +182,8 @@ class Learner(Process): if self._df[name].size < 5 : continue - _index = np.random.choice(np.arange(self._df[name].size),5,False) - no_value = [type(value) in [int,float,np.int64,np.int32,np.float32,np.float64] for value in self._df[name].values[_index]] + _index = np.random.choice(np.arange(self._df[name].shape[0]),5,False) + no_value = [type(value) in [int,float,np.int64,np.int32,np.float32,np.float64] for value in self._df[name].values[_index] if value is not None] no_value = 0 if np.sum(no_value) > 0 else '' try: self._df[name] = self._df[name].fillna(no_value)