I have that df:
gene person allele allele2
A1 p1 G C
A2 p1 A C
A3 p1 A T
A1 p2 G C
A2 p2 T T
A3 p2 G C
A4 p2 A T
A2 p1 G C
A3 p1 C C
...
As u can see, in table I can have same person few times (record form different laboratories). First p1 is different sample that second p1, and I need to pick only unique samples with best score (the highest number of rows), so it's that example it will be first p1 coz it's have 3 when another have 2.
And I have no idea how to extract that table to got something like this:
gene person allele allele2
A1 p1 G C
A2 p1 A C
A3 p1 A T
A1 p2 G C
A2 p2 T T
A3 p2 G C
A4 p2 A T
...
I thinking about indexing it by for loop. For example, add to index i if person == above person. If not, i+1. And then I will have a groups. But... whole df has 3mln row, so before I start I decide to describe here my problem. Maybe it's better way to do this?