Skip to content

Commit 8248079

Browse files
TST: Add test for pandas-dev#4980 (pandas-dev#44462)
1 parent 74b954e commit 8248079

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/frame/methods/test_rename.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,14 @@ def test_rename_with_duplicate_columns(self):
406406
],
407407
).set_index(["STK_ID", "RPT_Date"], drop=False)
408408
tm.assert_frame_equal(result, expected)
409+
410+
def test_rename_boolean_index(self):
411+
df = DataFrame(np.arange(15).reshape(3, 5), columns=[False, True, 2, 3, 4])
412+
mapper = {0: "foo", 1: "bar", 2: "bah"}
413+
res = df.rename(index=mapper)
414+
exp = DataFrame(
415+
np.arange(15).reshape(3, 5),
416+
columns=[False, True, 2, 3, 4],
417+
index=["foo", "bar", "bah"],
418+
)
419+
tm.assert_frame_equal(res, exp)

0 commit comments

Comments
 (0)