Skip to content

Commit 06a109c

Browse files
Merge pull request #110 from Quantmetry/angoho_fix_simple_methods
Fix: the problem of a column including nans in test but training set
2 parents 57e9f90 + 5889caf commit 06a109c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

qolmat/imputations/imputers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,9 @@ def fit(self, X: pd.DataFrame, y=None) -> Self:
159159
else:
160160
self.ngroups_ = pd.Series(0, index=df.index).rename("_ngroup")
161161

162-
cols_with_nans = df.columns[df.isna().any()]
163162
self._setup_fit()
164163
if self.columnwise:
165-
for col in cols_with_nans:
164+
for col in df.columns:
166165
self._fit_allgroups(df[[col]], col=col)
167166
else:
168167
self._fit_allgroups(df)

0 commit comments

Comments
 (0)