I have no idea if this is feasible in Pandas. I thought df.resample
may do the work but no. Here's my objective:
I have a time-series in a DataFrame
, df
that looks like this:
return
12:30:00 -0.000202
12:30:01 -0.000257
12:30:02 -0.000230
12:30:03 -0.000229
12:30:04 -0.000253
...
12:59:49 0.001491
12:59:50 0.001523
12:59:51 0.001503
12:59:52 0.001484
12:59:53 0.001513
12:59:54 0.001523
12:59:55 0.001527
12:59:56 0.001545
12:59:57 0.001532
12:59:58 0.001535
12:59:59 0.001566
13:00:00 0.001605
This is the plot:
Now you can you see that the time goes from 12:30:00 to 13:00:00
. I want to re-scale or stretch the this time-series to have observations from 12:30:00 to 14:15:00
. Hence I need to have 3.5 more entries in my original time-series... so 3.5 times more duplicate entries for each observation in my time-series. If it was only 3 time mores, then I would transform my data into array and use np.reshape()
and then re-assign a time index but this won't work in this particular case. Any suggestions?