title: Python for loop iterate in stepsize 3
body: <p>This might be a simple problem, but I seem to have spent too much time on it... My problem consist of creating a for loop that iterates through a list. </p>
  
  <p>For each iteration should three elements be extracted => those being i, i+1 and i+2.  But for some reason am I not able to iterate through the list without getting out of index or something like that?.. </p>
  
  <p>The way I currently iterating is as so: </p>
  
  <pre><code>        for i in xrange(0,len(data_train_output_full)-1,3):
              data = np.array([data_train_output_full[i],data_train_output_full[i+1],data_train_output_full[i+2]])
              data_train_output.append(data)
  </code></pre>
  
  <p>And the error message I am getting is: </p>
  
  <pre><code>IndexError: index 278 is out of bounds for axis 0 with size 278
  </code></pre>