I have a DataFrame like this
time val
2019-10-01 04:00:00.000 568830.000
2019-10-01 17:47:29.794 37612.000
2019-10-01 19:41:03.697 37.000
2019-10-01 19:41:03.698 37612.000
2019-10-02 00:16:07.224 376.000
2019-10-02 00:16:07.225 37612.000
2019-10-02 01:19:05.135 3761.000
2019-10-02 01:19:05.136 37612.000
2019-10-02 08:26:27.623 36612.000
2019-10-02 08:26:27.624 36493.000
2019-10-03 07:08:54.455 364.000
2019-10-03 07:08:54.456 36493.000
I want to create a new column that contains the last value within X minutes intervals e.g. 1 minute of column val.
Expected output:
time val result
2019-10-01 04:00:00.000 568830.000 568830.000
2019-10-01 17:47:29.794 37612.000 37612.000
2019-10-01 19:41:03.697 37.000 37612.000
2019-10-01 19:41:03.698 37612.000 37612.000
2019-10-02 00:16:07.224 376.000 37612.000
2019-10-02 00:16:07.225 37612.000 37612.000
2019-10-02 01:19:05.135 3761.000 37612.000
2019-10-02 01:19:05.136 37612.000 37612.000
2019-10-02 08:26:27.623 36612.000 36493.000
2019-10-02 08:26:27.624 36493.000 36493.000
2019-10-03 07:08:54.455 364.000 36493.000
2019-10-03 07:08:54.456 36493.000 36493.000