Using the following code df_grouped was created.
df_grouped = df.groupby(by='Pclass')
Below a loop prints the Pclass value as well as the length of each grouped amount.
for val,grp in df_grouped: print('There were',len(grp),'people traveling in',val,'class.')
How does the code access the information? How can val & grp be used without being referenced earlier? How is this information stored inside the groupby object?