title: Calculate cosine similarity of two matrices
body: <p>I have defined two <strong>matrices</strong> like following:</p>
  
  <pre><code>from scipy import linalg, mat, dot
  a = mat([-0.711,0.730])
  b = mat([-1.099,0.124])
  </code></pre>
  
  <p>Now, I want to calculate the cosine similarity of these two <strong>matrices</strong>. What is the wrong with following code. It gives me an error of <code>objects are not aligned</code></p>
  
  <pre><code>c = dot(a,b)/np.linalg.norm(a)/np.linalg.norm(b)
  </code></pre>