From 1dae4ffba8cba71f1cf8daf792cd0aa8b795431c Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 17 May 2022 13:27:13 -0500 Subject: [PATCH] bug fix: missing data, adding an additional type: pandas._lib.missing.NAType in addition to np.nan, np.na --- data/maker/__init__.py | 3 +-- data/maker/prepare/__init__.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index b9b48e4..c8dc02a 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -98,8 +98,7 @@ class Learner(Process): # - The code below tries to address the issue (Perhaps better suited for the reading components) for name in columns : _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]] - print ([name,np.sum(no_value)]) + 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) diff --git a/data/maker/prepare/__init__.py b/data/maker/prepare/__init__.py index 17da778..45fc61c 100644 --- a/data/maker/prepare/__init__.py +++ b/data/maker/prepare/__init__.py @@ -196,7 +196,6 @@ class Input : :param rows np.array or list of vector of values :param cols a space of values if it were to be different fromt he current sample. """ - if not cols: # # In the advent the sample rows do NOT have the values of the