Transform retail data with pandas groupby/merge/concat | Amazon SQL Question