How to check for each row in dataframe if all its values are in specified range?
import pandas as pd
new = pd.DataFrame({'a': [1,2,3], 'b': [-5,-8,-3], 'c': [20,0,0]})
For instance range <-5, 5>:
>>    a  b   c
>> 0  1 -5  20  # abs(20) > 5, hence no
>> 1  2 -8   0  # abs(-8) > 5, hence no
>> 2  3 -3   0  # abs(-3) <= 5, hence yes
Solution with iteration
print(['no' if any(abs(i) > 5 for i in a) else 'yes' for _, a in new.iterrows()])
>> ['no', 'no', 'yes']
 
     
    