We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13940c7 commit 66e83ccCopy full SHA for 66e83cc
pandas/core/generic.py
@@ -6893,7 +6893,7 @@ def interpolate(
6893
obj = self.T if should_transpose else self
6894
6895
if obj.empty:
6896
- return self
+ return self.copy()
6897
6898
if method not in fillna_methods:
6899
axis = self._info_axis_number
pandas/tests/frame/methods/test_interpolate.py
@@ -38,6 +38,7 @@ def test_interp_empty(self):
38
# https://github.com/pandas-dev/pandas/issues/35598
39
df = DataFrame()
40
result = df.interpolate()
41
+ assert result is not df
42
expected = df
43
tm.assert_frame_equal(result, expected)
44
0 commit comments