Skip to content

Commit 14f8172

Browse files
committed
REF: remove Block.putmask fallback to where
1 parent a59debc commit 14f8172

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

pandas/core/internals/blocks.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
Shape,
3131
npt,
3232
)
33-
from pandas.compat import np_version_under1p20
3433
from pandas.util._decorators import cache_readonly
3534
from pandas.util._exceptions import find_stack_level
3635
from pandas.util._validators import validate_bool_kwarg
@@ -39,7 +38,6 @@
3938
from pandas.core.dtypes.cast import (
4039
can_hold_element,
4140
find_result_type,
42-
infer_dtype_from,
4341
maybe_downcast_numeric,
4442
maybe_downcast_to_dtype,
4543
soft_convert_objects,
@@ -988,12 +986,6 @@ def putmask(self, mask, new) -> list[Block]:
988986
putmask_without_repeat(values.T, mask, new)
989987
return [self]
990988

991-
elif np_version_under1p20 and infer_dtype_from(new)[0].kind in ["m", "M"]:
992-
# using putmask with object dtype will incorrectly cast to object
993-
# Having excluded self._can_hold_element, we know we cannot operate
994-
# in-place, so we are safe using `where`
995-
return self.where(new, ~mask)
996-
997989
elif noop:
998990
return [self]
999991

0 commit comments

Comments
 (0)