pandas group by date and column code example Example: groupby year datetime pandas data.groupby(data.date.dt.year)