title: python ValueError: too many values to unpack (expected ....)
body: <p>I have defined the following function that takes an input string, and compares it to a large list of strings (both vectorized using tfidf):</p>
  
  <pre><code>def find_new_similar(tfidf_matrix2, index, tfidf_matrix, top_n = 5):
      cosine_similarities = linear_kernel(tfidf_matrix2[index:index+1], tfidf_matrix).flatten()
      related_docs_indices = [i for i in cosine_similarities.argsort()[::-1] if i != index]
      return [(i, cosine_similarities[i]) for i in related_docs_indices][0:top_n], index
  </code></pre>
  
  <p>when I call this function my output is:</p>
  
  <pre><code>    find_new_similar(tfidf_matrix2, 1, tfidf_matrix)
      Out[15]: 
      ([(923576, 0.51192576542407131),
        (558563, 0.51192576542407131),
        (1554977, 0.51192576542407131),
        (1604772, 0.51192576542407131),
        (514529, 0.50251903670563314)],
       1)
  </code></pre>
  
  <p>where the first element of each tuple (ie. 923576, 558563) is an index for a large file of terms. I would like to use these indexes and return the value at the index.</p>
  
  <pre><code>I have tried:
  
  
  for i, score in find_new_similar(tfidf_matrix2, 0, tfidf_matrix):
         print (score, corpus[i], i)
  Traceback (most recent call last):
  
    File "&lt;ipython-input-18-792db65f6fd0&gt;", line 1, in &lt;module&gt;
      for i, score in find_new_similar(tfidf_matrix2, 0, tfidf_matrix):
  
  ValueError: too many values to unpack (expected 2)
  </code></pre>
  
  <p>can anyone help? thanks?</p>