title: Creating a TF-IDF Matrix Python 3.6
body: <p>I have 100 documents(Each document is a simple list of words in that document). Now I want to create a TF-IDF matrix so that I can create a small word search by rank. I tried it using a tfidfVectorizer but got lost in the syntax. Any help would be much appreciated. Regards.</p>
  
  <p><strong>Edit</strong>: I converted the lists into strings and added them into a parent list:</p>
  
  <pre><code>vectorizer = TfidfVectorizer(vocabulary=word_set)
  matrix = vectorizer.fit_transform(doc_strings)
  print(matrix)
  </code></pre>
  
  <p>Here word_set is the set of possible distinct words and doc_strings is a list that contains each document as a string; However when I print the matrix I get output as below :</p>
  
  <pre><code>  (0, 839)  0.299458532286
    (0, 710)  0.420878518454
    (0, 666)  0.210439259227
    (0, 646)  0.149729266143
    (0, 550)  0.210439259227
    (0, 549)  0.210439259227
    (0, 508)  0.210439259227
    (0, 492)  0.149729266143
    (0, 479)  0.149729266143
    (0, 425)  0.149729266143
    (0, 401)  0.210439259227
    (0, 332)  0.210439259227
    (0, 310)  0.210439259227
    (0, 253)  0.149729266143
    (0, 216)  0.210439259227
    (0, 176)  0.149729266143
    (0, 122)  0.149729266143
    (0, 119)  0.210439259227
    (0, 111)  0.149729266143
    (0, 46)   0.210439259227
    (0, 26)   0.210439259227
    (0, 11)   0.149729266143
    (0, 0)    0.210439259227
    (1, 843)  0.0144007295367
    (1, 842)  0.0288014590734
    (1, 25)   0.0144007295367
    (1, 24)   0.0144007295367
    (1, 23)   0.0432021886101
    (1, 22)   0.0144007295367
    (1, 21)   0.0288014590734
    (1, 20)   0.0288014590734
    (1, 19)   0.0288014590734
    (1, 18)   0.0432021886101
    (1, 17)   0.0288014590734
    (1, 16)   0.0144007295367
    (1, 15)   0.0144007295367
    (1, 14)   0.0432021886101
    (1, 13)   0.0288014590734
    (1, 12)   0.0144007295367
    (1, 11)   0.0102462376715
    (1, 10)   0.0144007295367
    (1, 9)    0.0288014590734
    (1, 8)    0.0288014590734
    (1, 7)    0.0144007295367
    (1, 6)    0.0144007295367
    (1, 5)    0.0144007295367
    (1, 4)    0.0144007295367
    (1, 3)    0.0144007295367
    (1, 2)    0.0288014590734
    (1, 1)    0.0144007295367
  </code></pre>
  
  <p>Is this correct and If so, how can I search for the rank of a given word in a particular document. </p>