I have the below code and get the word count but getting the first letter frequency of all the words I don't understand how to do this. If there are three words starting with C in the file I would expect the outcome to be "C 3". I don't need to distinguish between caps so 'a' and 'A' will be the counted the same.
from mrjob.job import MRJob
class Job(MRJob):
def mapper(self,Key, value):
for char in value.strip().split():
yield char, 1
def reducer(self, Key, values):
yield Key, sum(values)
if __name__ == '__main__':
Job.run()