We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dca6901 commit 239d42aCopy full SHA for 239d42a
pandas/tests/groupby/test_indexing.py
@@ -285,3 +285,13 @@ def test_column_axis(column_group_df):
285
expected = column_group_df.iloc[:, [1, 3]]
286
287
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