title: python gives array is 1-dimensional, but 2 were indexed error
body: <p>I have coded mini_batch creator for miniBatchGradientDescent</p>
  <p>The code is here:</p>
  <pre><code># function to create a list containing mini-batches 
  def create_mini_batches(X,y, batch_size): 
      print(X.shape, y.shape) # gives (280, 34) (280,)
      splitData=[]
      splitDataResults=[]
      batchCount=X.shape[0] // batch_size #using floor division for getting indexes integer form 
      for i in range(batchCount):
              splitData.append(X[(i) * batch_size : (i+1) * batch_size, :])
              splitDataResults.append(y[(i) * batch_size : (i+1) * batch_size, :]) # GIVES ERROR
      splitData=np.asarray(splitData)
      splitDataResults=np.asarray(splitDataResults)
      return splitData, splitDataResults, batchCount
  </code></pre>
  <p>the error says:</p>
  <pre><code>splitDataResults.append(y[(i) * batch_size : (i+1) * batch_size, :])
  IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
  </code></pre>
  <p>I am sure that the shape is correct but it gives me an error. What is wrong?</p>