title: How to create new column in a df based on multiple conditions?
body: <p>I have a df with 3 columns: v1, v2, v3;where </p>
  
  <pre><code>v1=[a,b,c,a] 
  v2=[d,d,f,n] 
  v3=[a,k,i,j] 
  </code></pre>
  
  <p>What I like to do is to create new columns based on conditions in column v1~v3.</p>
  
  <p>I can do single condition, </p>
  
  <pre><code>df['v1_a']=np.where(df['v1']=='a',1,0)
  </code></pre>
  
  <p>it gives a new column named <code>'v1_a'</code> with <code>1/0</code> </p>
  
  <p>However, if I want to create a new column based on multiple conditions, this does not work: </p>
  
  <pre><code>df['v2_flag']=np.where(df['v2']=='f' or df['v2']=='h',1,0)
  </code></pre>
  
  <p>How can I accomplish this?</p>