I want to consider only rows which have one or more columns greater than a value. My actual df has 26 columns. I wanted an iterative solution. Below I am giving an example with three columns.
My code:
df = pd.DataFrame(np.random.randint(5, 15, (10, 3)), columns=list('abc'))
# In this dataframe I want to select rows that have one or more columns greater than 10.
# solution dataframe
sdf = df[(df['a']>10)|(df['b']>10)|(df['c']>10)]
How do I apply the same solution with 26 columns. Writing 26 columns inside [] I don't think is a pythonic way.