I have large dataframe with many groups, one might look like this:
id tnr tnr_grp tnr_a tnr_b 150001 1 0 1 0 15000