pivotdf = pd.pivot_table(meltdf, index=['State', 'RegionName', 'RegionID',
    'Metro', 'CountyName', 'SizeRank'], columns=['YearQuarter'], values=
    'Data', aggfunc=np.mean)
pandas how to use groupby to group columns by date in the label?