From d5dea5e2869e75236f2572591c3db369e628bea3 Mon Sep 17 00:00:00 2001 From: Dawid Makar Date: Wed, 27 Sep 2023 01:50:46 +0200 Subject: [PATCH] Automatic refactoring. Refactoring step id: UUID('96492e3d-b946-4432-a140-9d407e166ff2') --- pandas/tests/groupby/test_nth.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/pandas/tests/groupby/test_nth.py b/pandas/tests/groupby/test_nth.py index d2197ff202fb2..b451b834555fc 100644 --- a/pandas/tests/groupby/test_nth.py +++ b/pandas/tests/groupby/test_nth.py @@ -767,29 +767,6 @@ def test_groupby_nth_with_column_axis(): tm.assert_frame_equal(result, expected) -def test_groupby_nth_interval(): - # GH#24205 - idx_result = MultiIndex( - [ - pd.CategoricalIndex([pd.Interval(0, 1), pd.Interval(1, 2)]), - pd.CategoricalIndex([pd.Interval(0, 10), pd.Interval(10, 20)]), - ], - [[0, 0, 0, 1, 1], [0, 1, 1, 0, -1]], - ) - df_result = DataFrame({"col": range(len(idx_result))}, index=idx_result) - result = df_result.groupby(level=[0, 1], observed=False).nth(0) - val_expected = [0, 1, 3] - idx_expected = MultiIndex( - [ - pd.CategoricalIndex([pd.Interval(0, 1), pd.Interval(1, 2)]), - pd.CategoricalIndex([pd.Interval(0, 10), pd.Interval(10, 20)]), - ], - [[0, 0, 1], [0, 1, 0]], - ) - expected = DataFrame(val_expected, index=idx_expected, columns=["col"]) - tm.assert_frame_equal(result, expected) - - @pytest.mark.parametrize( "start, stop, expected_values, expected_columns", [ @@ -851,4 +828,4 @@ def test_head_tail_dropna_false(): tm.assert_frame_equal(result, expected) result = df.groupby(["X", "Y"], dropna=False).nth(n=0) - tm.assert_frame_equal(result, expected) + tm.assert_frame_equal(result, expected) \ No newline at end of file