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
grouped.agg(np.sum)
or a function like
grouped.agg('D' : lambda x: np.std(x, ddof=1))
But how do I apply a linregress which has TWO inputs X and Y?