Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

How is trade involved in a brands IMC?

Answered: 1 week ago