getting ValueError : “Can only tuple-index with a MultiIndex “

You have problem with i:(i+window_size), 0 in dataset[i:(i+window_size), 0].

In your code dataset means train_data['seq'] which is single column – single-dimensional Series – but you use i:(i+window_size), 0 like in two-dimensional DataFrame.

You can use only single integer like dataset[0] or slice dataset[i:(i+window_size)]

Leave a Comment