Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! I need helps on this question. Please concern to all the requirements and the question are asking for, and make sure it works. This

Hello! I need helps on this question. Please concern to all the requirements and the question are asking for, and make sure it works. This is a second post of the same question, please make sure it works.

Thank you so much!

image text in transcribed

image text in transcribed

image text in transcribed

uce.py home syllabus schedule assignments practice OH FAQ 1. Task Early in the days of "Big Data" the MapReduce programming model became quite popular. The core of this model is two functions, map and reduce, which you will write in this assignment. Write a file named map_reduce.py that implements two functions: 1.1. mymap(func, 1st) Given a single-argument function and a list, return a list containing the result of applying that function to each element of that list. For example, mymap(abs, [3,-1,4,-1 ,5,-9) should return [3, 1, 4, 1, 5, 9 1.2. myreduce(func, 1st) Given a two-argument function and a list, return the result of using the function repeatedly to combine all elements of the list into a single value. For example, myredu ce(pow, [3,-1,4,1,-5]) should compute pow(pow(pow(po(3, -1), 4), 1), -5) and return 3486784401.0. 1.3. Restrictions There are several full or partial implemenations of map and reduce in Python already; since this is a programming exercise, you may not use them. Do not import anything. Do not use the built-in function map. Do not use list comprehensions (you probably don't even know what those are, but if you do don't use them) Neither of your functions (nor the file itself) should print anything nor ask for any input. In addition to functional correctness, some points will be reserved for 1. having good variable names 2. having meaningful docstrings for all functions you write uce.py home syllabus schedule assignments practice OH FAQ 1. Task Early in the days of "Big Data" the MapReduce programming model became quite popular. The core of this model is two functions, map and reduce, which you will write in this assignment. Write a file named map_reduce.py that implements two functions: 1.1. mymap(func, 1st) Given a single-argument function and a list, return a list containing the result of applying that function to each element of that list. For example, mymap(abs, [3,-1,4,-1 ,5,-9) should return [3, 1, 4, 1, 5, 9 1.2. myreduce(func, 1st) Given a two-argument function and a list, return the result of using the function repeatedly to combine all elements of the list into a single value. For example, myredu ce(pow, [3,-1,4,1,-5]) should compute pow(pow(pow(po(3, -1), 4), 1), -5) and return 3486784401.0. 1.3. Restrictions There are several full or partial implemenations of map and reduce in Python already; since this is a programming exercise, you may not use them. Do not import anything. Do not use the built-in function map. Do not use list comprehensions (you probably don't even know what those are, but if you do don't use them) Neither of your functions (nor the file itself) should print anything nor ask for any input. In addition to functional correctness, some points will be reserved for 1. having good variable names 2. having meaningful docstrings for all functions you write

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

Are robots going to displace all workers? Explain your answer.

Answered: 1 week ago