title: Python numpy index is out of bound for axis zero
body: <p>I have a code written in Python similar to the following:</p>
  
  <pre><code>def adamic_adar_prediction(graph):
      adjacencyMatrix = graph.get_adjacency()
      AAMatrix = adamic_adar_score(graph)
      AAMatrix  = np.array(AAMatrix)
      i = (-AAMatrix ).argsort(axis=None, kind='mergesort')
      j = np.unravel_index(i, AAMatrix .shape)
      sortedList = np.vstack(j).T
      print(sortedList.size)
  
      print(sortedList[1658943])
      print(sortedList[1658945])
  </code></pre>
  
  <p>While the result of the first print is 3,316,888 I receive the following error for the last print:</p>
  
  <p><code>IndexError: index 1658944 is out of bounds for axis 0 with size 1658944</code></p>
  
  <p>Any idea why this error arises for my array?</p>