
i have this result from group by my df, how can i take a list name of City from this result df? i found this solving problem but i dont know how this for loop works:

i think result is 2 part, index list and a new dataframe, so when input city,df in groupby df. it will return first list is city and the other in df. Is it true? but the type of df when i print(type(df)) is list, i thought it containt all the list except index list i had push into city. but when i try for loop with city,df,df1,df2,.. error appear :(