bug fix: random empty values
This commit is contained in:
parent
e47ffb3fae
commit
afad884118
|
@ -269,7 +269,7 @@ class Input :
|
||||||
|
|
||||||
# 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()
|
||||||
|
|
||||||
x = _matrix.apply(lambda row: _values[row.values == 1].tolist()[0] if (row.values == 1).sum() > 0 else np.random.choice(np.matrix.flatten(_values,1)).tolist() ,axis=1).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()
|
||||||
return pd.DataFrame(x,columns=columns)
|
return pd.DataFrame(x,columns=columns)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue