Forum Discussion
veranceftw
4 years agoHelper II
Rolling Mean Average
Hello, I have a dataset that looks like this:
| date | time | value | worker_id |
| 2021 01 07 | 1 | 0.2 | 14562 |
| 2021 01 07 | 10 | 0.1 | 14562 |
| 2021 01 07 | 15 | 0.45 | 14562 |
| 2021 01 07 | 22 | 0.05 | 15452 |
| 2021 01 07 | 29 | 0.01 | 15452 |
| 2021 01 08 | 5 | 0.23 | 55641 |
| 2021 01 08 | 9 | 0.45 | 55641 |
| 2021 01 08 | 13 | 0.63 | 55641 |
| 2021 01 08 | 16 | 0.87 | 55641 |
| 2021 01 08 | 21 | 0.25 | 123 |
| 2021 01 09 | 16 | 0.001 | 655 |
| 2021 01 09 | 33 | 0.005 | 41541 |
| 2021 01 09 | 45 | 0.56 | 41541 |
| 2021 01 09 | 46 | 0.98 | 41541 |
| 2021 01 09 | 52 | 0.47 | 41541 |
| 2021 01 09 | 57 | 0.53 | 41541 |
| 2021 01 10 | 1 | 0.1 | 41541 |
| 2021 01 10 | 3 | 0.35 | 41541 |
| 2021 01 10 | 5 | 0.25 | 41541 |
| 2021 01 10 | 7 | 0.89 | 41541 |
| 2021 01 10 | 11 | 0.24 | 41541 |
| 2021 01 10 | 13 | 0.22 | 41541 |
Each user has a certain value throughout the time on a certain date.
I would like to get the rolling mean average at every 3 values per user following the date/time order.
Thank you! 🙂
3 Replies
- Ashish_MathurSuper User
Hi,
Please show the expected result very clearly.
- veranceftwHelper II
The output would be the rolling mean average per user with window = 3.
I don't know why the date is messed up in the post but it should look like this:
Actions are ordered by date and time, the rolling mean average should be calculated at every 3 actions.
- Ashish_MathurSuper User
Hi,
I still do not understand your requirement. Someone else who does will help you.