0
df1 = df1.resample('1min').ffill()

I am forward filling the missing values of a time series with index as DateTimeIndex for a stock ticker between time 9:15 to 15:30. The last entry in my dataframe has the time as 15:29. So, when I tried to forward fill, the missing times are getting forward filled only until 15:29 but I want the data to be filled until 15:30. How can I achieve this?

I can obviously add a new row with 15:30 as index and put the same value as in the last entry. But looking for a cleaner approach

1 Answers1

0

Try ffilling twice.

df1 = df1.resample('1min').ffill().ffill()
drew wood
  • 195
  • 1
  • 5