I have a dataframe with boolean values. If any of the values is False, I want to do something. I have 2 options to do so:
In [1]: import pandas as pd
In [2]: df = pd.DataFrame(data = [{'bool': False}, {'bool': True}])
In [3]: df
Out[3]: 
    bool
0  False
1   True
In [4]: if (df['bool'] is False).any():
   ...:     print ('yay!!!!')
   ...: 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-0c98c5d85cb6> in <module>
----> 1 if (df['bool'] is False).any():
      2     print ('yay!!!!')
      3 
AttributeError: 'bool' object has no attribute 'any'
In [5]: if (df['bool'] == False).any():
   ...:     print ('yay!!!!')
   ...: 
yay!!!!
As you can see, the 1st (is) fails, and the 2nd (==) succeeds. However, when running pre-commit (version 1.20.0) on this, I get the following error:
E712 comparison to False should be 'if cond is not False:' or 'if cond:'
which reverts me back to the 1st solution (which doesn't work)
How can I solve this?
Python 3.6.12
pandas==1.1.5
 
    