hours = ['hour%s' % i for i in np.arange(1, 11)]
X[hours] = X[times].apply(lambda x: [h.hour for h in x], axis=1)
test[hours] = test[times].apply(lambda x: [h.hour for h in x], axis=1)
KeyError: "['hour1' 'hour2' 'hour3' 'hour4' 'hour5' 'hour6' 'hour7' 'hour8' 'hour9'\n 'hour10'] not in index"