Skip to content

Commit f608b22

Browse files
author
Marco Gorelli
committed
👌 add copy=False to .rename_axis, use tm instead of pd.testing
1 parent 5046588 commit f608b22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6767,7 +6767,7 @@ def append(self, other, ignore_index=False, verify_integrity=False, sort=False):
67676767
other.reindex(combined_columns, copy=False)
67686768
.to_frame()
67696769
.T.infer_objects()
6770-
.rename_axis(index.names)
6770+
.rename_axis(index.names, copy=False)
67716771
)
67726772
if not self.columns.equals(combined_columns):
67736773
self = self.reindex(columns=combined_columns)

pandas/tests/frame/test_combine_concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def test_append_timestamps_aware_or_naive(self, tz_naive_fixture, timestamp):
297297
df = pd.DataFrame([pd.Timestamp(timestamp, tz=tz)])
298298
result = df.append(df.iloc[0]).iloc[-1]
299299
expected = pd.Series(pd.Timestamp(timestamp, tz=tz), name=0)
300-
pd.testing.assert_series_equal(result, expected)
300+
tm.assert_series_equal(result, expected)
301301

302302
def test_update(self):
303303
df = DataFrame(

0 commit comments

Comments
 (0)