From afad88411811c67000514f75c3cc4b79c6a38455 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 10 Aug 2022 17:23:42 -0500 Subject: [PATCH] bug fix: random empty values --- data/maker/prepare/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/maker/prepare/__init__.py b/data/maker/prepare/__init__.py index 1fae46c..a19fd31 100644 --- a/data/maker/prepare/__init__.py +++ b/data/maker/prepare/__init__.py @@ -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.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)