I have an excel file that I'm taking data from. The data is basically a table of a day, and people playing together
day | pl1 | pl2 |
---|---|---|
Mon | 1000 | 1011 |
Tue | 1100 | 0101 |
Tue | 1000 | 0121 |
Wed | 0101 | 1101 |
Mon | 0210 | 1212 |
Wed | 1000 | 0101 |
I want to check that no id is playing more than once(regardless if it is in column of pl1 or pl2) in one day. For example , in Wed, we have "0101" two times, one as pl1, and one in pl1, and I want to catch this.
And I'm looking of which would be the fastest and more pythonic way.
I have thought of checking all elements of pl1 list, and pl2 and if I find same value anywhere, check if the value on the column of the day, is same, or not. However, not only I think this would be extremely slow to process, I also think is more complicate to check
The other thought is to move them in lists of lists [[Mon,1000,1012],[Tue,1110,0101]...] and group them by day and then, check also the rest of elements? Still seems that too much time.
Should I create a list of touples instead ? (I already use tupples and check that there is no identical pairs (same id and in same position pl1 an pl2)
Is there any fastest and more compact way ?
Thanks