I have a dataframe which has hundreds of columns, I want to return a set of the columns that contain only true/false strings.
i.e.
a b c d e
true false 34 cat true
false false 16 dog true
true true 16 cow false
I wish to return ['a', 'b', 'e']
All of the stack overflow questions I find seem to be searching for the string within the column header rather than within the row values.
Once it is found to contain a single example of true/false the column should be added to the list but I am wary that I would have to search the entire dataframe as it may contain a number of NULL's
My data is very large, is there a way I can optimise this search?