see soon regardless of the objective in using groupbya generally useful groupby method is size which return series containing group sizesin [ ]df groupby(['key ''key ']size(out[ ]key key one two one two as of this writingany missing values in group key will be excluded from the result it' possible (andin factquite likely)that by the time you are reading this there will be an option to include the na group in the result iterating over groups the groupby object supports iterationgenerating sequence of -tuples containing the group name along with the chunk of data consider the following small example data setin [ ]for namegroup in df groupby('key ')print name print group data data key key - one two one data data key key - one - two in the case of multiple keysthe first element in the tuple will be tuple of key valuesin [ ]for ( )group in df groupby(['key ''key '])print print group one data data key key - one one two data data key key two one data data key key groupby mechanics www it-ebooks info