I have the following Pandas dataframe:
I have a timestamp and a value. I would now like to duplicate the values of the column "value" 4 times and have 15 minute timestamps. So for the timestamps
01.01.2022 00:00 --> 4.8000
01.01.2022 00:15 --> 4.8000
01.01.2022 00:30 --> 4.8000
01.01.2022 00:45 --> 4.8000
And so on
I tried the following but it did not really work:
df['timestamp'] = pd.to_datetime(df['timestamp'], format='%d.%m.%Y %H:%M')
df1 = df.set_index('timestamp').asfreq('15T')
df1['value'].interpolate()
Any idea how I can do that?
CodePudding user response:
Add parameter method='ffill'
to
It worked for me,
I hope it works for you too,
Best of luck