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