Implemented pandas export for groupby queries