.
self.lookahead - 1 train_start_idx = train_end_idx + self.train_length + self.lookahead - 1 split_idx.append([train_start_idx, train_end_idx, test_start_idx, test_end_idx]) dates = X.reset_index()[['date']] for train_start, train_end, test_start, test_end in split_idx: train_idx = dates[(dates.date