()
| 622 | |
| 623 | |
| 624 | def test_apply_multi_index(): |
| 625 | index = MultiIndex.from_arrays([["a", "a", "b"], ["c", "d", "d"]]) |
| 626 | s = DataFrame([[1, 2], [3, 4], [5, 6]], index=index, columns=["col1", "col2"]) |
| 627 | result = s.apply(lambda x: Series({"min": min(x), "max": max(x)}), 1) |
| 628 | expected = DataFrame([[1, 2], [3, 4], [5, 6]], index=index, columns=["min", "max"]) |
| 629 | tm.assert_frame_equal(result, expected, check_like=True) |
| 630 | |
| 631 | |
| 632 | @pytest.mark.parametrize( |