title: Checking for NaNs in many columns in Pandas
body: <p>I want to add a binary column to my dataframe based on whether given columns contain NaN or not.</p>
  
  <p>I have tried to do it with the below code.</p>
  
  <pre><code>import pandas as pd
  
  dat = pd.DataFrame({'A': [12,34,56,78, 23,None, None], 'B': [90,80,70,23,None, 78, None], 'C': [90,80,70,23,None, 78, None], 'D': [12,34,56,78, 23,None, None]})
  dat['A1'] = dat['A'].isnull()
  dat['B1'] = dat['B'].isnull()
  dat['C1'] = dat['C'].isnull()
  dat['ismissing'] = 1 if dat['A1'] == True and dat['B1'] == True and dat['C1'] == True else 0
  dat
  </code></pre>
  
  <p>but I got a ValueError at the line before last.</p>
  
  <pre><code>ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>
  
  <p>Sample input:</p>
  
  <pre><code>A     B     C     D
  10   NaN    40    NaN
  NaN  NaN    80    90
  20    45    NaN   89
  NaN  NaN    NaN   46
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>A     B     C     D     E
  10   NaN    40    NaN   0
  NaN  NaN    80    90    0
  20    45    NaN   89    0
  NaN  NaN    NaN   46    1
  </code></pre>
  
  <p>I want to check NaNs only for A, B, C columns.</p>