title: How to apply linregress in Pandas bygroup
body: <p>I would like to apply a scipy.stats.linregress within Pandas ByGroup. I had looked through the documentation but all I could see was how to apply something to a single column like </p>
  
  <pre><code>grouped.agg(np.sum)
  </code></pre>
  
  <p>or a function like</p>
  
  <pre><code>grouped.agg('D' : lambda x: np.std(x, ddof=1)) 
  </code></pre>
  
  <p>But how do I apply a linregress which has TWO inputs X and Y?</p>