I want to find all the rows that have the same values across all columns, or more specifically, drop all the rows that have difference. I was thinking I would iterate through each column and check for the greatest majority and remove the other rows. I feel like this method is not the best way to utilize a dataframe.
I was checking previous posts and someone had a similar question but they wanted the inverse result so I will use their example:
Input:
index A B C D E F ....
0 1 2 3 4 2 2
1 1 2 3 4 2 2
2 5 5 5 5 5 5
3 7 7 6 7 7 7
Desired Output:
index A B C D E F ....
0 1 2 3 4 2 2
1 1 2 3 4 2 2
There can be many columns here.
Edit: The example I provided is wrong. Sorry I was tired. I have updated the example. Now that I have typed out my question I think I am basically just asking how do I find the rows that are all the same. If there are multiple groups of identical rows I want to know those as well.