title: numpy.dot -> MemoryError, my_dot -> very slow, but works. Why?
body: <p>I am trying to compute the dot product of two numpy arrays sized respectively (162225, 10000) and (10000, 100). However, if I call numpy.dot(A, B) a MemoryError happens.
  I, then, tried to write my implementation:</p>
  
  <pre><code>def slower_dot (A, B):
      """Low-memory implementation of dot product"""
      #Assuming A and B are of the right type and size
      R = np.empty([A.shape[0], B.shape[1]])
      for i in range(A.shape[0]):
          for j in range(B.shape[1]):
              R[i,j] = np.dot(A[i,:], B[:,j])
      return R
  </code></pre>
  
  <p>and it works just fine, but is of course very slow. Any idea of 1) what is the reason behind this behaviour and 2) how I could circumvent / solve the problem?</p>
  
  <p>I am using Python 3.4.2 (64bit) and Numpy 1.9.1 on a 64bit equipped computer with 16GB of ram running Ubuntu 14.10.</p>