title: Can I calculate element-wise product using an np.matrix?
body: <p>I know I can do matrix multiplication using numpy arrays by using the <code>.dot</code> syntax. The regular <code>*</code> multiplication does element-wise multiplication.</p>
  
  <pre><code>a = np.array([[1,2],[3,4]])
  print 'matrix multiplication', a.dot(a)
  print 'element-wise multiplication', a * a
  
  &gt; matrix multiplication [[ 7 10]  [15 22]] 
  &gt; element-wise multiplication [[ 1  4]  [ 9 16]] 
  </code></pre>
  
  <p>This works fine, but it's the opposite of all matrix operations I've ever learnt (i.e. the "dot product" is typically element-wise, and the regular product is typically a full matrix multiplication.)</p>
  
  <p>So I'm investigating <code>np.matrix</code>. The nice thing is that matrix multiplication uses the <code>*</code> operator, but I'm to understand how to do element-wise multiplication. </p>
  
  <pre><code>m = np.matrix(a)
  print 'matrix multiplication', m * m
  print 'more matrix multiplication? ', m.dot(m)
  
  &gt; matrix multiplication [[ 7 10]  [15 22]] 
  &gt; more matrix multiplication?  [[ 7 10]  [15 22]]
  </code></pre>
  
  <p>I understand what's happening - there is not <code>.dot</code> operator for numpy matrix, so it falls through to the base <code>np.array</code> implementation. But does this mean that there's no way to calculate a dot product using <code>np.matrix</code>?</p>
  
  <p>Is this just another argument for avoiding <code>np.matrix</code> and instead sticking with <code>np.array</code>?</p>