Skip to content Skip to sidebar Skip to footer

Getting ValueError : "Can Only Tuple-index With A MultiIndex "

I am trying to implement a simple RNN to predict the next integer in an integer sequence. So, I have a data set that is as below: Id Sequence 1 1,0,0,2,24,552,21280,103760,70299

Solution 1:

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)]


Post a Comment for "Getting ValueError : "Can Only Tuple-index With A MultiIndex ""