title: Concatenate two columns
body: <p>I have two text columns A and B. I want to take the first non empty string or if both A and B has values take the values from A. C is the column im trying to create:</p>
  <pre><code>import pandas as pd
  
  cols = ['A','B']
  data = [['data','data'],
          ['','data'],
          ['',''],
          ['data1','data2']]
  
  df = pd.DataFrame.from_records(data=data, columns=cols)
  
        A      B
  0  data   data
  1         data
  2             
  3  data1  data2
  </code></pre>
  <p>My attempt:</p>
  <pre><code>df['C'] = df[cols].apply(lambda row: sorted([val if val else '' for val in row], reverse=True)[0], axis=1) #Reverse sort to avoid picking an empty string
  
        A      B      C
  0  data   data      data
  1         data      data
  2             
  3  data1  data2     data2 #I want data1 here
  </code></pre>
  <p>Expected output:</p>
  <pre><code>      A      B      C
  0  data   data      data
  1         data      data
  2             
  3  data1  data2     data1
  </code></pre>
  <p>I think I want the pandas equivalent of SQL coalesce.</p>