I have a dataframe like so:
Apple Orange Strawberry
0 1 1
0 1 1
0 1 0
0 1 0
0 1 0
0 1 1
0 1 1
I want to filter the dataframe such that I get the column names where all the rows are a specific value say 0.
In this case I would get Apple
I tried doing
df[rowSums(df<1)==0, ]
but I'm just getting an empty dataframe with all the column names. Is there something else I can try?