From 7e92571d0acf99d042a2c43b3621c50eb831cafe Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 14 Jun 2022 12:24:56 -0500 Subject: [PATCH] bug fix: errors occasionally --- data/maker/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 71d9c7b..60fc418 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -105,8 +105,10 @@ class Learner(Process): _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]] no_value = 0 if np.sum(no_value) > 0 else '' - - self._df[name] = self._df[name].fillna(no_value) + try: + self._df[name] = self._df[name].fillna(no_value) + finally: + pass _log[name] = self._df[name].dtypes.name _log = {'action':'structure','input':_log}