'After converting dates into datetimeindex and resample them into weekly frequency, how can I then use groupby function to group a category

What I articulate in the title probably is confusing. Essentially I am trying to find the total entries of a certain student every week. The given data has dates, student name, response entries. I am confused about how I should categorize each student through groupby, and then sum them into weekly data. I convert the date into datetimeindex and resample them into weekly data but then the previous student categorization disappears and I don't know how to group by index.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source