I need to groupby week, however a week like this one (the first week of the year) spans two years, 2018 and 2019.
Typically I would do the following:
df.groupby([df.DATE.dt.year,df.DATE.dt.week]).sum()
which results in the single week characterized as two separate weeks in the output. I am sure I can brute force with IF statements, however I am wondering if there is a more clean way to group by week during these year transitions.