0
votes

So I have a dataset that has electricity load over 24 hours:

Time_of_Day= loadData.groupby(loadData.index.hour).mean() Time_of_Day

        Load

          
         Time       Load    
2019-01-01 01:00:00 38.045
2019-01-01 02:00:00 30.675
2019-01-01 03:00:00 22.570
2019-01-01 04:00:00 22.153
2019-01-01 05:00:00 21.085
... ...
2019-12-31 20:00:00 65.565
2019-12-31 21:00:00 53.513
2019-12-31 22:00:00 49.096
2019-12-31 23:00:00 44.409
2020-01-01 00:00:00 45.744

and a cost for each hour throughout the year

             Time       Cost
0   2019-01-01 01:00:00 0.081
1   2019-01-01 02:00:00 0.055
2   2019-01-01 03:00:00 0.046
3   2019-01-01 04:00:00 0.055
4   2019-01-01 05:00:00 0.052
... ... ...
8755    2019-12-31 20:00:00 0.105
8756    2019-12-31 21:00:00 0.104
8757    2019-12-31 22:00:00 0.048
8758    2019-12-31 23:00:00 0.054
8759    2020-01-01 00:00:00 0.115

Cost.describe() prints:

Cost
count   8760.000000
mean    0.106380
std 0.069693
min -0.080000
25% 0.051000
50% 0.104000
75% 0.141000
max 0.400000

How do I please write a code that creates a column called "shifted load" and this column would move some of the load to another time of day depending on the price? So let's say when the price is between 75% and max price. half of the load would be shifted to a diff time of the day during the same 24 hours that the price is between min to 50%.

Ideally, say when its 6 pm and the price is between 75% and max , I'd want the code to shift half of the load to a time during the same 24 hours that the price is cheap(min-25%)

Sorry if my explanation isn't great but any help or being pointed in the right direction would be great.