title: python pandas .map double variable lambda
body: <p>I was looking for a way to do column operations (like in excel for instance) using pandas without iterating through each row of the environment. I am dealing with potentially very large pd.DataFrame objects and would like to use functions where possible.<br>
  I have made use of mapping lambda functions to do similar things in the past:   </p>
  
  <pre><code>df['a'] = df['a'].map(lambda x: int(str(int(x))[:-1])) #remove the last digit in column 'a'
  </code></pre>
  
  <p>Would it be possible to map something like the following lambda function to mimic a SQL coalesce function? </p>
  
  <pre><code>lambda x,y: x if x else y
  </code></pre>
  
  <p>Where x and y are both columns (similar to the first example), and I'd like to use the lambda to generate a third column object.</p>