Skip to content

Commit 239d42a

Browse files
committed
added test to indexing on groupby, pandas-dev#32464
1 parent dca6901 commit 239d42a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/groupby/test_indexing.py

+10
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,13 @@ def test_column_axis(column_group_df):
285285
expected = column_group_df.iloc[:, [1, 3]]
286286

287287
tm.assert_frame_equal(result, expected)
288+
289+
290+
def test_if_is_multiindex():
291+
a = pd.DataFrame({"a": [], "b": [], "c": []})
292+
293+
index_1 = a.groupby(["a", "b"]).sum().index
294+
index_2 = a.groupby(["a", "b", "c"]).sum().index
295+
296+
assert isinstance(index_2, pd.core.indexes.multi.MultiIndex)
297+
assert type(index_1) == type(index_2)

0 commit comments

Comments
 (0)