Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Python/Numpy What's it called / how do you represent that operation where you multiply each element of two vectors?
  2. x = array([1, 2, 3])
  3. y = array([4, 5, 6])
  4.        
  5. from numpy import *
  6. x = array([1,2,3])
  7. y = array([2,2,2])
  8. inner(x,y)          <-- Should give 1*2 + 2*2 + 3*2 = 12