Converting a Pandas GroupBy output from Series to DataFrame Converting a Pandas GroupBy output from Series to DataFrame pandas pandas