title: How to have list's elements as a condition in np.where()?
body: <p>I want to create a new column based on the values of another column where there are certain conditions to be evaluated for the values assigned in the new column.</p>
  
  <p>I read a few questions and answers (<a href="https://stackoverflow.com/questions/39307268/numpy-np-where-multiple-condition">Numpy np.where multiple condition</a>) involving <code>np.where()</code> but was unable to deduce the best(efficient) Pythonic way.</p>
  
  <p>Sample dataframe is:</p>
  
  <pre><code>      period
  0      JAN16 
  1  YTD JAN16
  </code></pre>
  
  <p>I want to assign values to column <code>period_type</code> on the following condition:
  if period starts with x (where x is any element of a list -> ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']), then period_type = 'month', else, period_type = period.split(0)</p>
  
  <p>I would like the dataframe to be:</p>
  
  <pre><code>      period period_type
  0      JAN16       month
  1      JAN16       YTD
  </code></pre>
  
  <p>I am unable to apply any logic in my code whatsoever:</p>
  
  <pre><code>df.loc[df['c1'] == 'Value', 'c2'] = 10
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>df['c2'] = np.where(df.c1 == 8,'X',df.c3)
  </code></pre>