title: Python: Cosine Similarity m * n matrices
body: <p>I have two M X N matrices which I construct after extracting data from images. Both the vectors have lengthy first row and after the 3rd row they all become only first column. 
  for example raw vector looks like this</p>
  
  <pre><code>1,23,2,5,6,2,2,6,2,
  12,4,5,5,
  1,2,4,
  1,
  2,
  2
  :
  </code></pre>
  
  <p>Both vectors have a similar pattern where first three rows have lengthy row and then thin out as it progress. Do do cosine similarity I was thinking to use a padding technique to add zeros and make these two vectors N X N. I looked at Python options of cosine similarity but some examples were using a package call numpy. I couldn't figure out how exactly numpy can do this type of padding and carry out a cosine similarity. Any guidance would be greatly appreciated. </p>