title: How to fix "IndexError" on python?
body: <p>I am a beginner who studies machine learning and tries to train neural networks. but there is a problem when I run my code. error saying "
  IndexError: index 114 outside the limit for 0 axis with size 93 ". how this can happen dan how to fix it? thank you in advance if you can help me</p>
  
  <p>this is the code that i used neupy library</p>
  
  <pre><code>optimizer = algorithms.LevenbergMarquardt(
      [
         layers.Input(6),
         layers.Sigmoid(12),
         layers.Relu(6),
      ],
      shuffle_data=True,
      verbose=True,
  
  )
  
  print("Training...")
  optimizer.train(X_train, X_test, y_train, y_test,epochs=100)
  </code></pre>
  
  <p>the input is 6 features of glcm with 6 label output. I have split the data into testing and training data using <code>train_test_split</code>.
  this is data that I have split</p>
  
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
  print("Jumlah data latih   : ", len(X_train))
  print("Jumlah data uji     : ", len(y_train))
  print("Jumlah data latih   : ", len(X_test))
  print("Jumlah data uji     : ", len(y_test))
  </code></pre>
  
  <p>Jumlah data latih   :  372
  Jumlah data uji     :  372
  Jumlah data latih   :  93
  Jumlah data uji     :  93</p>
  
  <p>And this is the error message</p>
  
  <pre><code>IndexError                                Traceback (most recent call last)
  
  &lt;ipython-input-8-8e9b3836f4ce&gt; in &lt;module&gt;()
       16 
       17 print("Training...")
  ---&gt; 18 optimizer.train(X_train, X_test, y_train, y_test,epochs=100)
       19 
       20 p = optimizer.predict(testdata)
  
  5 frames
  
  /usr/local/lib/python3.6/dist-packages/neupy/algorithms/gd/base.py in train(self, X_train, y_train, X_test, y_test, *args, **kwargs)
      299             X_train=X_train, y_train=y_train,
      300             X_test=X_test, y_test=y_test,
  --&gt; 301             *args, **kwargs)
      302 
      303     def one_training_update(self, X_train, y_train):
  
  /usr/local/lib/python3.6/dist-packages/neupy/algorithms/base.py in train(self, X_train, y_train, X_test, y_test, epochs, batch_size)
      264                 )
      265 
  --&gt; 266                 for X_batch, y_batch in iterator:
      267                     self.events.trigger('update_start')
      268                     update_start_time = time.time()
  
  /usr/local/lib/python3.6/dist-packages/neupy/utils/iters.py in minibatches(inputs, batch_size, shuffle)
       64         for index in range(n_batches):
       65             batch_slice = slice(index * batch_size, (index + 1) * batch_size)
  ---&gt; 66             yield apply_slices(inputs, indices[batch_slice])
       67 
       68     elif n_batches != 1:
  
  /usr/local/lib/python3.6/dist-packages/neupy/utils/iters.py in apply_slices(inputs, indices)
       30 
       31     if isinstance(inputs, (list, tuple)):
  ---&gt; 32         return [apply_slices(input_, indices) for input_ in inputs]
       33 
       34     return inputs[indices]
  
  /usr/local/lib/python3.6/dist-packages/neupy/utils/iters.py in &lt;listcomp&gt;(.0)
       30 
       31     if isinstance(inputs, (list, tuple)):
  ---&gt; 32         return [apply_slices(input_, indices) for input_ in inputs]
       33 
       34     return inputs[indices]
  
  /usr/local/lib/python3.6/dist-packages/neupy/utils/iters.py in apply_slices(inputs, indices)
       32         return [apply_slices(input_, indices) for input_ in inputs]
       33 
  ---&gt; 34     return inputs[indices]
       35 
       36 
  
  IndexError: index 114 is out of bounds for axis 0 with size 93
  </code></pre>