Skip to content

Commit 343b78b

Browse files
committed
pandas-dev#24205: test_groupby_nth_interval created
1 parent d61e523 commit 343b78b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pandas/tests/groupby/test_nth.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -768,25 +768,27 @@ def test_groupby_nth_with_column_axis():
768768

769769

770770
def test_groupby_nth_interval():
771-
# GH24205
772-
idx_result = pd.MultiIndex(
773-
[pd.CategoricalIndex([pd.Interval(0, 1),pd.Interval(1, 2)]),
771+
#24205
772+
idx_result = MultiIndex(
773+
[
774+
pd.CategoricalIndex([pd.Interval(0, 1),pd.Interval(1, 2)]),
774775
pd.CategoricalIndex([pd.Interval(0, 10), pd.Interval(10, 20)])
775776
],
776-
[[0, 0, 0, 1, 1],
777+
[
778+
[0, 0, 0, 1, 1],
777779
[0, 1, 1, 0, -1]
778780
]
779781
)
780782
df_result = pd.DataFrame({'col': range(len(idx_result))}, index=idx_result)
781-
782783
result = df_result.groupby(level=[0, 1],observed=False).nth(0)
783-
784784
val_expected = [0,1,3]
785-
idx_expected = pd.MultiIndex(
786-
[pd.CategoricalIndex([pd.Interval(0, 1),pd.Interval(1, 2)]),
785+
idx_expected = MultiIndex(
786+
[
787+
pd.CategoricalIndex([pd.Interval(0, 1),pd.Interval(1, 2)]),
787788
pd.CategoricalIndex([pd.Interval(0, 10), pd.Interval(10, 20)])
788789
],
789-
[[0, 0, 1],
790+
[
791+
[0, 0, 1],
790792
[0, 1, 0]
791793
]
792794
)

0 commit comments

Comments
 (0)