bug fix with data-frame

This commit is contained in:
Steve Nyemba 2023-08-08 09:30:28 -05:00
parent a0a2d8ae56
commit 8e997675f8
1 changed files with 2 additions and 2 deletions

View File

@ -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)