Python: choosing rows in an array: IndexError: too many indices for array

0

I'm trying to build a model from an array with 572 rows and 8 columns loaded with NumPy. I defined the sets as:

train_x = x_vals[(11:34, 46:98, 110:268, 280:342, 354:408, 420:428, 440:478, 490:538, 550:571]

test_x = x_vals[0:10, 35:45, 99:109, 269:279, 343:353, 409:419, 429:439, 479:489, 539:549]

train_y = y_vals[11:34, 46:98, 110:268, 280:342, 354:408, 420:428, 440:478, 490:538, 550:571]

test_y = y_vals[0:10, 35:45, 99:109, 269:279, 343:353, 409:419, 429:439, 479:489, 539:549]

I am trying to test my model with 99 samples and calibrate with 473. Although the Spyder environment accepts the declarations of the above lines, at the time of running the program it appears:

train_x = x_vals[11:34, 46:98, 110:268, 280:342, 354:408, 420:428, 440:478, 490:538, 550:571]
IndexError: too many indices for array

What is missing from the statement above?

    
asked by anonymous 14.06.2018 / 22:34

0 answers