在DateTIme上执行groupby之后创建索引

我有以下格式的以下数据(请参见下文)

enter image description here

接下来,我将进行重铸,分组和平均(请参见代码)以减少数据维数。

df_mod=pd.read_csv('wet_bulb_hr.csv')
#Mod Date
df_mod['wbt_date'] = pd.to_datetime(df_mod['wbt_date']) 

#Mod Time
df_mod['wbt_time'] = df_mod['wbt_time'].astype('int')
df_mod['wbt_date'] = df_mod['wbt_date'] + \
                     pd.to_timedelta(df_mod['wbt_time']-1, unit='h')

df_mod['wet_bulb_temperature'] = \
df_mod['wet_bulb_temperature'].astype('float')
df = df_mod
df = df.drop(['wbt_time','_id'], axis = 1)
#df_novel = df.mean()
df = df.groupby([df.wbt_date.dt.year,df.wbt_date.dt.month]).mean()

写入输出文件后,我得到的输出看起来像这样。

enter image description here

进一步调查,我可以理解原因。我所有的处理都导致数据框的形状为1,但我真正需要的是要导出的2个wbt_date列。由于groupby函数,似乎没有发生这种情况

enter image description here

My question: How do I generate an index and have the groupby wbt_date columns as a new single column such that the output is: enter image description here