format = '%Y%m%d %H'
times = pd.to_datetime(df.YYYYMMDD + ' ' + df.HH, format=format)
df.set_index(times, inplace=True)
df = df.drop(['YYYYMMDD', 'HH'], axis=1)
Parse dates when YYYYMMDD and HH are in separate columns using pandas in Python