Let assume we dataframe with data with name df: -
Name Scores Project_score Attendence
1 Kahn 25 0 0
2 Uri 22 0 0
3 John 24 0 0
4 Shushi 21 0 0
5 Johnny 25 0 0
I want to drop the columns that has max and min value equal to zero from the data. Note:- This is just a example data, there are more 100 columns in the data so we cannot all columns by selecting one by one using the code below
df.drop(['Attendence','Project_score'])
I need a loop statement or any function that can atleast retrieve me the names of the columns that has min and max value qual to zero.