title: i have this error: IndexError: index 40 is out of bounds for axis 0 with size 40, i can't understand the fount of the error. pls
body: <pre><code>import pandas as pd
  import numpy as np
  import sklearn
  from sklearn import linear_model
  import matplotlib.pyplot as pyplot
  import pickle
  from matplotlib import style
  
  data = pd.read_csv(&quot;student-mat.csv&quot;  , sep=&quot;;&quot;)
  data = data[[&quot;age&quot;, &quot;traveltime&quot; , &quot;studytime&quot; ,&quot;failures&quot; , &quot;G1&quot; , &quot;G2&quot; , &quot;G3&quot;]]
  
  predict = &quot;age&quot;
  
  x = np.array(data.drop([predict], 1))
  y = np.array(data[predict])
  
  x_train , x_test , y_train , y_test =  sklearn.model_selection.train_test_split(x , y, test_size= 0.1)
  
  linear=linear_model.LinearRegression()
  linear.fit(x,y)
  
  acc = linear.score(x_test , y_test)
  print(acc)
  
  print('co: \n', linear.coef_)
  print('intercept: \n', linear.intercept_)
  
  predictions = linear.predict(x_train)
  
  for x in range(len(predictions)):
      print(predictions[x], x_test[x], y_test[x])
  
  style.use(&quot;ggplot&quot;)
  pyplot.scatter(data[&quot;age&quot;] , data[&quot;failures&quot;])
  pyplot.xlabel(&quot;traveltime&quot;)
  pyplot.ylabel(&quot;studytime&quot;)
  pyplot.show()
  </code></pre>
  <p>guys, i've searched a lot on the internet about this error but i didn't found anything
  the error is on this line: print(predictions[x], x_test[x], y_test[x]), i can't understand were the error come from</p>