I want to drop rows where all values are the same. But, I want solution that can apply to 1,2,3,4...n columns.
df = pd.DataFrame({"Col1":[1,4,2,5,1,4],
"Col2":[4,5,2,2,3,4],
"Col3":[5,1,2,5,1,4],
"Col4":[3,1,2,4,2,4]})
print(df)
Col1 Col2 Col3 Col4
0 1 4 5 3
1 4 5 1 1
2 2 2 2 2 # delete
3 5 2 5 4
4 1 3 1 2
5 4 4 4 4 # delete
This is the example of 4 columns, but I do not know how to find solution for this. So in this case, rows 2 and 5 should be dropped.