for i, row in enumerate(a):
    groups[tuple(row[c] for c in key_columns)].append(i)
return list(groups.values())
How do I get the indexes of unique row for a specified column in a two dimensional array