def read_t6(filepath):
with open(filepath, 'rb') as f:
dtype = [('time', 'f8'), ('high', 'f4'), ('low', 'f4'), ('open', 'f4'),
('close', 'f4'), ('val', 'f4'), ('vol', 'f4')]
df = pd.DataFrame(np.frombuffer(f.read(), dtype=dtype).astype(dtype))
df['time'] = pd.to_datetime(df['time'],unit='D', origin=pd.Timestamp('1899-12-30'))
df=df.set_index("time")
ohlc_dict = {'open':'first', 'high':'max', 'low':'min', 'close': 'last'}
return df.resample('15Min').agg(ohlc_dict)
dT6=read_t6("EURUSD_2020.t6")
dT6.head()