title: how to get the average number of words in a text in mrjob?
body: <p>Im stuck with a simple problem in mrjob mareduce framework: I want to get the average number of words in a given parragraph and i got this:</p>
  
  <pre><code>class LineAverage(MRJob):
  
  def mapper(self, _, line):
      numwords = len(line.split())
      yield "words", numwords
      yield "lines", 1
  
  
  def reducer(self, key, values):
      yield key, sum(values)
  </code></pre>
  
  <p>With this code, i get after reduce process, the total of lines and words in the text, but i dont know how to get the average by doing:</p>
  
  <pre><code>words/TotalOfLines
  </code></pre>
  
  <p>I am newbie in this model of programming, if anyone can illustrate this example it'll be very appreciated.</p>
  
  <p>In the meantime, thank you so much for your attention and participation</p>