title: Apply formula across pandas rows/ regression line
body: <p>I'm trying to apply a formula across the rows of a data frame to get the trend of the numbers in the rows. </p>
  
  <p>The below example works until the part where <code>.apply</code> is used.</p>
  
  <pre><code>df = pd.DataFrame(np.random.randn(10, 4), columns=list('ABCD'))
  axisvalues=list(range(1,len(db.columns)+1))
  
  def calc_slope(row):
      return scipy.stats.linregress(df.iloc[row,:], y=axisvalues)
  
  calc_slope(1) # this works
  
  df["New"]=df.apply(calc_slope,axis=1) # this fails *- "too many values to unpack"*
  </code></pre>
  
  <p>Thank you for any help</p>