Question: Hello I need help with this small program using python and anaconda (The columns for the datafile timesheet.csv are: ID numbers of Drivers, the weeks

Hello I need help with this small program using python and anaconda (The columns for the datafile "timesheet.csv" are: ID numbers of Drivers, the weeks they are driving, no of hours in each week they are driving, and the miles they are covering each week.)

  1. Write two map-reduce programs which will demonstrate:
    1. Each driver has driven a total no of hours
    2. Each driver has a total no. of miles
    3. Your code will have comments

  1. The python code to be modified:
from mrjob.job import MRJob class MRRatingCounter(MRJob): def mapper(self, key, line): (userID, movieID, rating, timestamp) = line.split('\t') yield rating, 1 # yield = return the ratings and no 1 adds all the ratings up in the reducer stage def reducer(self, rating, occurences): yield rating, sum(occurences) if __name__ == '__main__': MRRatingCounter.run()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!