I looking for the amount of user in date range(-7) from pandas dataframe
Example.
UserID | Date (Y/M/D) |
---|---|
100 | 2021/02/15 |
100 | 2021/02/10 |
100 | 2021/02/8 |
101 | 2021/02/10 |
102 | 2021/02/15 |
103 | 2021/02/10 |
What should I start I want receive result like it
UserID | Date (Y/M/D) | Count |
---|---|---|
100 | 2021/02/15 | 3 ## Because date (15 - 7) is 8 in dataframe it have 3 row in range 15 - 8 |
100 | 2021/02/10 | 2 ## Because date (10 - 7) is 3 in dataframe it have 2 row in range 10 - 3 |
100 | 2021/02/8 | 1 |
101 | 2021/02/10 | 1 |
102 | 2021/02/15 | 1 |
103 | 2021/02/10 | 1 |