pandas: support complex computations in by reductions