Skip to content

Commit 7e31210

Browse files
CLN: deduplicate in core.internals.blocks.interpolate (#34638)
1 parent 942beba commit 7e31210

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

pandas/core/internals/blocks.py

+3-15
Original file line numberDiff line numberDiff line change
@@ -1084,14 +1084,9 @@ def interpolate(
10841084

10851085
inplace = validate_bool_kwarg(inplace, "inplace")
10861086

1087-
def check_int_bool(self, inplace):
1088-
# Only FloatBlocks will contain NaNs.
1089-
# timedelta subclasses IntBlock
1090-
if (self.is_bool or self.is_integer) and not self.is_timedelta:
1091-
if inplace:
1092-
return self
1093-
else:
1094-
return self.copy()
1087+
# Only FloatBlocks will contain NaNs. timedelta subclasses IntBlock
1088+
if (self.is_bool or self.is_integer) and not self.is_timedelta:
1089+
return self if inplace else self.copy()
10951090

10961091
# a fill na type method
10971092
try:
@@ -1100,9 +1095,6 @@ def check_int_bool(self, inplace):
11001095
m = None
11011096

11021097
if m is not None:
1103-
r = check_int_bool(self, inplace)
1104-
if r is not None:
1105-
return r
11061098
return self._interpolate_with_fill(
11071099
method=m,
11081100
axis=axis,
@@ -1115,10 +1107,6 @@ def check_int_bool(self, inplace):
11151107
# validate the interp method
11161108
m = missing.clean_interp_method(method, **kwargs)
11171109

1118-
r = check_int_bool(self, inplace)
1119-
if r is not None:
1120-
return r
1121-
11221110
assert index is not None # for mypy
11231111

11241112
return self._interpolate(

0 commit comments

Comments
 (0)