Skip to content

CLN: deduplicate in core.internals.blocks.interpolate #34638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,9 @@ def interpolate(

inplace = validate_bool_kwarg(inplace, "inplace")

def check_int_bool(self, inplace):
# Only FloatBlocks will contain NaNs.
# timedelta subclasses IntBlock
if (self.is_bool or self.is_integer) and not self.is_timedelta:
if inplace:
return self
else:
return self.copy()
# Only FloatBlocks will contain NaNs. timedelta subclasses IntBlock
if (self.is_bool or self.is_integer) and not self.is_timedelta:
return self if inplace else self.copy()

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

if m is not None:
r = check_int_bool(self, inplace)
if r is not None:
return r
return self._interpolate_with_fill(
method=m,
axis=axis,
Expand All @@ -1115,10 +1107,6 @@ def check_int_bool(self, inplace):
# validate the interp method
m = missing.clean_interp_method(method, **kwargs)

r = check_int_bool(self, inplace)
if r is not None:
return r

assert index is not None # for mypy

return self._interpolate(
Expand Down