I want to use a boolean to select the columns with more than 4000 entries from a dataframe comb which has over 1,000 columns. This expression gives me a Boolean
comb
Another solution is to transpose comb to make its columns act as its index, then transpose on the resulting subset:
comb.T[criteria].T
Again, not particularly elegant, but at least shorter/less repetitive than the leading solution.