title: fill new column of pandas DataFrame based on if-else of other columns
body: <p>I have a situation where I want to create a new column in a Pandas DataFrame and populate it according to conditions involving 2 other columns. In this example:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df = pd.DataFrame(np.array([['value1','value2'],['value',np.NaN],[np.NaN,np.NaN]]), columns=['col1','col2'])
  </code></pre>
  
  <p>I would like to create a new column, 'new col', which consists of 1) the value in 'col2' if it is not NaN else, 2) the value in 'col1' if it is not NaN else, 3) NaN</p>
  
  <p>I am trying this function with .apply() but it is not returning the desired result</p>
  
  <pre><code>def singleval(row):
      if row['col2'] != np.NaN:
          val = row['col2']
      elif row['col1'] != np.NaN:
          val = row['col1']
      else:
          val = np.NaN
      return val
  
  df['new col'] = df.apply(singleval,axis=1)
  </code></pre>
  
  <p>i want the values in 'new col' to be <code>['value2', 'value', 'nan']</code></p>