I am trying to group by on a timeseries dataset so that I can find most frequent day of week, week of month etc.
My dataset looks something like this:
ID Date
1 2020-01-02
1 2020-01-09
1 2020-01-08
My output dataset should look something like this:
ID Pref_Day_Of_Week_A Pref_Week_Of_Month_A
1 4 2
(Here Thursday is the mode day of week, and the 2nd week is mode week of month for given dates) So essentially trying to find out the mode(most frequent) day of week and mode(most frequent) week of month for each ID. Any idea how to achieve this in Python? The dataset contains multiple such IDs, this is just example of 1 such ID, the dataset has multiple IDs with similar timestamp data.