diff --git a/pandas/tests/groupby/test_function.py b/pandas/tests/groupby/test_function.py index 93e9b5bb776ab..45ac77bac9e02 100644 --- a/pandas/tests/groupby/test_function.py +++ b/pandas/tests/groupby/test_function.py @@ -1574,3 +1574,15 @@ def test_corrwith_with_1_axis(): ) expected = Series([np.nan] * 6, index=index) tm.assert_series_equal(result, expected) + + +def test_multiindex_group_all_columns_when_empty(groupby_func): + # GH 32464 + df = DataFrame({"a": [], "b": [], "c": []}).set_index(["a", "b", "c"]) + gb = df.groupby(["a", "b", "c"]) + method = getattr(gb, groupby_func) + args = get_groupby_method_args(groupby_func, df) + + result = method(*args).index + expected = df.index + tm.assert_index_equal(result, expected)