0

When we apply resampling with frequency 15min, it creates a dataframe where its index has been rounded down to the nearest 15 minutes, for example:

df.resample('15min')['col1'].sum()

time                            value
2022-01-31 09:00:00+00:00    0.01023882 
2022-01-31 09:15:00+00:00    0.02558220  
2022-01-31 09:30:00+00:00    0.0003999   
2022-01-31 09:45:00+00:00    0.01110556  

However what I'm looking for is as below:

time                            value
2022-01-31 09:14:59+00:00    0.01023882 
2022-01-31 09:29:59+00:00    0.02558220  
2022-01-31 09:44:59+00:00    0.0003999   
2022-01-31 09:59:59+00:00    0.01110556  

EDIT:

Thanks to the simple solution commented by @Mustafa Aydın, I got the desired df.

df.index = df.index + pd.Timedelta("14 min 59 sec")
sci9
  • 700
  • 1
  • 7
  • 21

0 Answers0