Pandas: transforming the DataFrameGroupBy object to desired format,df = df.reset_index()