title: Using map and zip to sum multiple vectors in a matrix
body: <p>EDIT: Original post was too long winded...</p>
  
  <p><strong>Is there any way to vectorize the operation below - maybe using map, numpy or list comprehension?</strong> I do not want to use explicit for loops.</p>
  
  <pre><code>vec = np.zeros(150,)
  for i in range(len(w)):
      vec += matrix[a.index(list(w)[i])]*w[list(w)[i]]
  </code></pre>
  
  <p>For example, like so:</p>
  
  <pre><code>vec = map(sum, [zip(vec, matrix[a.index(list(w)[i])]*w[list(w)[i]]) for i in range(len(w))] )
  </code></pre>
  
  <p>The problem with my <code>map</code> code above is that I get <code>TypeError</code>'s. If anyone can advise that would be great, thanks.</p>