I have a dataframe, which looks like this:
Date Price Type
2018-08-17 10:48:02 120 A
2018-08-17 10:55:02 100 A
2018-08-17 10:57:02 70 B
2018-08-17 10:58:07 69 B
2018-08-20 22:58:13 56 A
2018-08-21 04:19:53 79 A
2018-08-21 04:29:56 40 A
2018-08-21 09:15:07 11 B
2018-08-21 17:07:03 600 A
2018-08-21 17:57:11 225 C
I want to transform Date column, so it shows only day and hour and for values in column "Price", they must sum for each hour depending on column Type. So, desired result must look like this:
Date Price_sum Type
2018-08-17 10:00:00 220 A
2018-08-17 10:00:00 139 B
2018-08-20 22:00:00 56 A
2018-08-21 04:00:00 119 A
2018-08-21 09:00:00 11 B
2018-08-21 17:00:00 600 A
2018-08-21 17:00:00 225 C
How could i get it? I have no idea