Skip to content

Commit eb88e43

Browse files
committed
feedback: test roundtrip
1 parent f2f710f commit eb88e43

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/indexing/test_categorical.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,6 @@ def test_reindexing_with_missing_values(self):
660660
data = {"col": range(len(index))}
661661
df = DataFrame(data=data, index=index)
662662

663-
res = df.reset_index()
664-
665663
expected = pd.DataFrame(
666664
{
667665
"level_0": pd.Categorical.from_codes(
@@ -674,6 +672,11 @@ def test_reindexing_with_missing_values(self):
674672
}
675673
)
676674

675+
res = df.reset_index()
676+
tm.assert_frame_equal(res, expected)
677+
678+
# roundtrip
679+
res = expected.set_index(["level_0", "level_1"]).reset_index()
677680
tm.assert_frame_equal(res, expected)
678681

679682
def test_loc_and_at_with_categorical_index(self):

0 commit comments

Comments
 (0)