title: Create a new variable by checking conditions on multiple columns
body: <p>I am new to Python and just started to learn <code>pandas</code>. I want to create a new variable by checking conditions on multiple columns.</p>
  
  <pre><code>import pandas as pd
  import datetime
  import numpy as np
  </code></pre>
  
  <p>Let's say I have the following dataframe</p>
  
  <pre><code>d = {'CUSTNO':[123, 124, 125, 126], 'STATUS':['ACTIVE', 'NO', 'CANCEL', 'ACTIVE'], 'CANCEL':[np.nan, '2019-08-09', np.nan, '2019-09-17']}
  df = pd.DataFrame(d)
  df['CANCEL'] = df['CANCEL'].apply(lambda x: pd.to_datetime(x, format = '%Y-%m-%d', errors = 'coerce'))
  
  
   CUSTNO  STATUS      CANCEL
  0   123  ACTIVE         NaT
  1   124      NO  2019-08-09
  2   125  CANCEL         NaT
  3   126  ACTIVE  2019-09-17
  </code></pre>
  
  <p>The conditions that I would like to apply is as follows:</p>
  
  <p>if <code>df['STATUS']</code> values are 'NO' or 'CANCEL' or <code>df['CANCEL']</code> contains date values: <code>HOLDING</code> will be set to 'N', Otherwise 'Y'.</p>
  
  <p>The expected return as follows:</p>
  
  <pre><code> CUSTNO  STATUS     CANCLE  HOLDING
  0   123  ACTIVE        NaT        Y
  1   124      NO 2019-08-09        N
  2   125  CANCLE        NaT        N
  3   126  ACTIVE 2019-09-17        N
  </code></pre>
  
  <p>Could you please give suggestions?  </p>