bug fix: random empty values

This commit is contained in:
Steve Nyemba 2022-08-10 17:33:48 -05:00
parent d8aad070ee
commit 96ac4cd9cb
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ class Input :
#@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()
novalues = _values[np.random.choice(_values.size,1)[0]].tolist()
novalues = _values[np.random.choice( len(_values),1)[0]].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)