title: Converting bsxfun with @times to numpy
body: <p>This is the code I have in Octave:</p>
  
  <pre><code>sum(bsxfun(@times, X*Y, X), 2)
  </code></pre>
  
  <p>The bsxfun part of the code produces element-wise multiplication so I thought that <code>numpy.multiply(X*Y, X)</code> would do the trick but I got an exception. When I did a bit of research I found that element-wise multiplication won't work on Python arrays (specifically if X and Y are of type "numpy.ndarray"). So I was wondering if anyone can explain this a bit more -- i.e. would type casting to a different type of object work? The Octave code works so I know I don't have a linear algebra mistake. I'm assuming that bsxfun and numpy.multiply are not actually equivalent but I'm not sure why so any explanations would be great.</p>
  
  <p>I was able to find a <a href="http://mathesaurus.sourceforge.net/matlab-numpy.html">website</a>! that gives Octave to Matlab function conversions but it didn't seem to be help in my case.</p>