The groupby() operation creates "groupby" objects that you can work with. The groups themselves have key/value pairs Follow this example:
#%%
import pandas as pd
# make a dataframe
df = pd.DataFrame([['foo', 'baz', 1, 9.3],
['foo', 'baz', 1, 9.4],
['foo', 'baz', 3, 9.5],
['bar', 'bash',5, 1.7],
['bar', 'bash',10, 1.8],
['bar', 'junk',11, 2.3]],
columns=['col_a', 'col_b', 'col_c', 'col_d'])
print(df)
#%% create a groupby object;
# use two dimension columns & one measure column from the original df
gr = df[['col_a', 'col_b', 'col_c']].groupby(by=['col_a', 'col_b'])
print(type(gr))
#%% typical aggregate method of a groupby object
gr_sum = gr.agg({'col_c':'sum'})
print(gr_sum)
#%% look at the groups within the groupby object (dict)
print(gr.groups.keys())
#%% now that you have the keys, you can work with specific groups
print(gr.get_group(('bar', 'bash')))
#%% or you can create a dataframe of only the keys
# (to finally answer the OP's question)
df_no_agg = pd.DataFrame(gr.groups.keys())
print(df_no_agg)
#%% simplify & put it all together in one line of code
pd.DataFrame(df.groupby(by=['col_a', 'col_b']).groups.keys())