bug fix: random empty values

dev
Steve Nyemba 2 years ago
parent afad884118
commit d8aad070ee

@ -268,8 +268,9 @@ class Input :
#@TODO: Provide random values for things that are missing #@TODO: Provide random values for things that are missing
# x = _matrix.apply(lambda row: _values[row.values == 1].tolist()[0] if (row.values == 1).sum() > 0 else np.repeat(None,len(self._columns)) ,axis=1).tolist() # x = _matrix.apply(lambda row: _values[row.values == 1].tolist()[0] if (row.values == 1).sum() > 0 else np.repeat(None,len(self._columns)) ,axis=1).tolist()
novalues = _values[np.random.choice(_values.size,1)[0]].tolist()
x = _matrix.apply(lambda row: _values[row.values == 1].tolist()[0] if (row.values == 1).sum() > 0 else _values[np.random.choice(_values.size,1 )].tolist() ,axis=1).tolist() # novalues = np.repeat(None,len(self._columns))
x = _matrix.apply(lambda row: _values[row.values == 1].tolist()[0] if (row.values == 1).sum() > 0 else novalues ,axis=1).tolist()
return pd.DataFrame(x,columns=columns) return pd.DataFrame(x,columns=columns)

Loading…
Cancel
Save