I have the following pandas dataframe. Each point is combined with 'n' class points of each class, and each combination has a value of 0 or 1. Now for each point, I want to get the class which has the highest number of '0'. Output : Pt.1 - a Pt.2 -b
I have tried with hash table, but its being a bit cumbersome. What can be an elegant pandas dataframe query for this?
+------+-------+-------+--+--+--+
| Pt. | class | value | | | |
+------+-------+-------+--+--+--+
| Pt.1 | a | 0 | | | |
| Pt.1 | a | 0 | | | |
| Pt.1 | a | 1 | | | |
| Pt.1 | b | 0 | | | |
| Pt.1 | b | 1 | | | |
| pt.1 | b | 1 | | | |
| Pt.2 | a | 1 | | | |
| Pt.2 | a | 1 | | | |
| Pt.2 | a | 1 | | | |
| Pt.2 | b | 0 | | | |
| Pt.2 | b | 0 | | | |
| Pt.2 | b | 0 | | | |
| | | | | | |
+------+-------+-------+--+--+--+
rtag here?