data_grouped_children = data.groupby(['children', 'debt']).agg({'debt':'count'}) data_grouped_children