1# You can also reset_index() on your groupby result to get back a dataframe with the name column now accessible.
2
3import pandas as pd
4df = pd.DataFrame({"a":[1,1,3], "b":[4,5.5,6], "c":[7,8,9], "name":["hello","hello","foo"]})
5
6df_grouped = df.groupby(["a", "name"]).median().reset_index() # Resetting the index makes the column accessible
7
8df_grouped.name
9
10 #Output:
11 0 hello
12 1 foo