title: Summation of TFIDF sparse vector values for each document in Spark with Python
body: <p>I calculated the TFIDF for 3 sample text documents using HashingTF and IDF of Pyspark and I got the following SparseVector result:</p>
  
  <pre><code>(1048576,[558379],[1.43841036226])
  (1048576,[181911,558379,959994],  [0.287682072452,0.287682072452,0.287682072452])
  (1048576,[181911,959994],[0.287682072452,0.287682072452])
  </code></pre>
  
  <p>How to calculate the sum of TFIDF values for all terms within a document. 
  E.g. (0.287682072452 + 0.287682072452) for the 3d document.</p>