title: Pandas: df.groupby(x, y).apply() across multiple columns parameter error
body: <h3>Basic Problem:</h3>
  
  <p>I have several 'past' and 'present' variables that I'd like to perform a simple percent change '<em>row-wise</em>' on. For example: <code>((exports_now - exports_past)/exports_past))</code>.</p>
  
  <p>These two questions accomplish this but when I try a similar method I get an error that my function deltas gets an unknown parameter <code>axis</code>.  </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/13331698/how-to-apply-a-function-to-two-columns-of-pandas-dataframe">How to apply a function to two columns of Pandas dataframe</a></li>
  <li><a href="https://stackoverflow.com/questions/16353729/pandas-how-to-use-apply-function-to-multiple-columns">Pandas: How to use apply function to multiple columns</a></li>
  </ul>
  
  <h3>Data Example :</h3>
  
  <pre><code>exports_ past    exports_ now    imports_ past    imports_ now    ect.(6 other pairs)
     .23               .45             .43             .22              1.23
     .13               .21             .47             .32               .23
      0                 0              .41             .42               .93
     .23               .66             .43             .22               .21
      0                .12             .47             .21              1.23
  </code></pre>
  
  <p>Following the answer in the first question,                 </p>
  
  <h3>My solution is to use a function like this:</h3>
  
  <pre><code>def deltas(row):
      '''
      simple pct change
      '''
      if int(row[0]) == 0 and int(row[1]) == 0:
          return 0
      elif int(row[0]) == 0:
          return np.nan
      else:
          return ((row[1] - row[0])/row[0])
  </code></pre>
  
  <h3>And apply the function like this:</h3>
  
  <pre><code>df['exports_delta'] = df.groupby(['exports_past', 'exports_now']).apply(deltas, axis=1)
  </code></pre>
  
  <p>This generates this error : <code>TypeError: deltas() got an unexpected keyword argument 'axis'</code>
  Any Ideas on how to get around the axis parameter error? Or a more elegant way to calculate the pct change? The kicker with my problem is that I needs be able to apply this function across several different column pairs,  so hard coding the column names like the answer in 2nd question is undesirable. Thanks!</p>