title: Reduce list of word, count tuples up to aggregate key
body: <p>I am trying to take the Spark word count example and aggregate word counts by some other value (for example, words and counts by person where person is "VI" or "MO" in the case below) </p>
  
  <p>I have an rdd which is a list of tuples whose values are lists of tuples:</p>
  
  <pre><code>from operator import add
  reduced_tokens = tokenized.reduceByKey(add)
  reduced_tokens.take(2)
  </code></pre>
  
  <p>Which gives me:</p>
  
  <pre><code>[(u'VI', [(u'word1', 1), (u'word2', 1), (u'word3', 1)]),
   (u'MO',
    [(u'word4', 1),
     (u'word4', 1),
     (u'word5', 1),
     (u'word8', 1),
     (u'word10', 1),
     (u'word1', 1),
     (u'word4', 1),
     (u'word6', 1),
     (u'word9', 1),
     ...
   )]
  </code></pre>
  
  <p>I want something like:</p>
  
  <pre><code>[
   ('VI', 
      [(u'word1', 1), (u'word2', 1), (u'word3', 1)],
   ('MO', 
      [(u'word4', 58), (u'word8', 2), (u'word9', 23) ...)
  ]
  </code></pre>
  
  <p>Similar to the <a href="https://www.cloudera.com/documentation/enterprise/5-5-x/topics/spark_develop_run.html" rel="nofollow noreferrer">word count example here</a>, I would like to be able to filter out words with a count below some threshold for some person. Thanks!</p>