Pandas > Select columns using condition with all/any

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,100,size=(3, 3)), columns=['C1','C2','C3'])
print ("dataframe")
print (dataframe)
dataframe2 = dataframe.loc[:,(dataframe>50).any()]
print ("dataframe selected columns")
print (dataframe2)
dataframe3 = dataframe.loc[:,(dataframe>50).all()]
print ("dataframe selected columns")
print (dataframe3)
dataframe
   C1  C2  C3
0  80  41  76
1  38   6  57
2  45  14  84
dataframe selected columns
   C1  C3
0  80  76
1  38  57
2  45  84
dataframe selected columns
   C3
0  76
1  57
2  84