<human>:  How to count number of rows in a group in pandas group by object?
<bot>: Here is some code to count number of rows in a group `key_columns` in pandas groupby object `df`

df.groupby(key_columns).size()

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.