Pandas datetime groupby
data.groupby(data.date.dt.year)
ashattack
data.groupby(data.date.dt.year)
df['date_minus_time'] = df["_id"].apply( lambda df :
datetime.datetime(year=df.year, month=df.month, day=df.day))
df.set_index(df["date_minus_time"],inplace=True)