Skip to content

Commit

Permalink
Don't print removed cols when none are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sverchkov authored Aug 14, 2023
1 parent af4abec commit 8dbc669
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def remove_bad_cols(X: Union[pd.Series, pd.DataFrame], limited_var_thresh: float
final_cols = without_sparse.columns
dropped_cols = orig_cols[~orig_cols.isin(final_cols)]
print(f'{len(dropped_cols)} removed, {len(final_cols)} remaining.')
print(f'Columns removed: {list(dropped_cols)}')
if len(dropped_cols) > 0:
print(f'Columns removed: {list(dropped_cols)}')

# Return
return without_sparse
Expand Down

0 comments on commit 8dbc669

Please sign in to comment.