I have a pandas df \'instr_bar\' with tick data as follows:
time
2016-07-29 16:07:24 5.72
2016-07-29 16:07:24 5.72
2016-07-29 16:07:24 5.72
2016-07-2
try bfill():
instr_bar = instr_bar.resample('5T').ohlc().bfill()
or ffill():
instr_bar = instr_bar.resample('5T').ohlc().ffill()
depending on what do you want to achieve
if you want to filter rows by time you can use between_time() method:
instr_bar.between_time('09:00', '16:30')
altogether:
instr_bar = instr_bar.resample('5T').ohlc().ffill().between_time('09:00', '16:30')