title: populate new column in a pandas dataframe which takes input from other columns
body: <p>i have a function which should take x , y , z as input and returns r as output.
  For example : my_func( x , y, z) takes x = 10 , y = 'apple' and z = 2 and returns value in column r. Similarly, function takes x = 20, y = 'orange' and z =4 and populates values in column r. Any suggestions what would be the efficient code for this ?</p>
  
  <p>Before :</p>
  
  <pre><code>   a  x       y       z      
     5  10   'apple'    2
     2  20   'orange'   4
     0  4    'apple'    2
     5  5    'pear'     6
  </code></pre>
  
  <p>After: </p>
  
  <pre><code>   a  x       y       z      r
     5  10   'apple'    2      x
     2  20   'orange'   4      x
     10  4   'apple'    2      x
     5  5    'pear'     6      x
  </code></pre>