title: Numpy slicing with batch size
body: <p>I have a numpy array <code>A</code> of shape <code>(550,10)</code>. I have batch size of 100 i.e how much data rows I want from <code>A</code>. In each iteration I want to extract 100 rows from A. But when I reach last 50 rows, I want last 50 and first 50 rows from A. </p>
  
  <p>I have a function like this:</p>
  
  <pre><code>def train(index, batch_size):
  
      if(batch_size + index &lt; A.shape(0)):
            data_end_index = index + batch_size
            batch_data = A[index:batch_end_index,:]
      else:
            data_end_index = index + batch_size - A.shape(0) #550+100-600 = 50
            batch_data = A[500 to 549 and 0 to 49] # How to slice here ?
  </code></pre>
  
  <p>How to perform last step ?</p>