I am trying to calculate the gradient between each row of the same group with
def get_gradient(row, row2): return (row[\'foo\'] - row2[\'foo\'])/(row[\'ba