Skip to content

Commit

Permalink
simple logic to keep null
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Sep 13, 2024
1 parent dc45f6b commit a12be85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ibis_ml/steps/_handle_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def transform_table(self, table: ir.Table) -> ir.Table:
(table[col_name] >= stat["lower_bound"])
& (table[col_name] <= stat["upper_bound"])
| (
(table[col_name].isnull() | table[col_name].isnan()) # noqa: PD003
if table[col_name].type().is_floating()
else table[col_name].isnull() # noqa: PD003
table[col_name].isnull() # noqa: PD003
| table[col_name].type().is_floating()
& table[col_name].isnan()
)
)
for col_name, stat in self.stats_.items()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_handle_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_handle_univariate_outliers(
{
# use same value for easier calculation statistics
"int_col": [0] * 10, # mean = 0, std = 0 Q1 = 0, Q3 = 0
"floating_col": [0.0] * 10, # mean = 0, std = 0 Q1 = 0, Q3 = 0
"floating_col": [0.0] * 10, # mean = 0, std = 0, Q1 = 0, Q3 = 0
}
)

Expand Down

0 comments on commit a12be85

Please sign in to comment.