Answered You can hire a professional tutor to get the answer.

QUESTION

In-put-data file: datafile.

In-put-data file:

datafile.txt = {increasement 822 tonsillolith sope 149 808 pollinigerous earth-devouring 609 881 181 731 226 539 249 274 817 692 poduran 267 749 657 forelaying 737 505

393 267 276 985 geld 3 20 640 305 squillagee 595 limited 836 crotcheting 742 352 UPI superintolerable 71 315 675 599 257 675 596

earth-god 629}

myMapper.py

#!/usr/bin/python 

import sys 

resultNumbers = [] 

for line in sys.stdin : 

listA = line.split(" ") 

for i in listA : 

if(i.isdigit()): 

if(int(i) % 2 != 0): 

if(i not in resultNumbers): 

resultNumbers.append(int(i)) 

# print the odd numbers 

print("The odd numbers in input : "+ str(resultNumbers)) 

The data that comes from the above script myMapper.py must be feed-in as the input-file as the python script below 

myReducer.py

myReducer.py

#!/usr/bin/python

import sys

resultNumbers = []

for line in sys.stdin:

  listA = line.split(" ")

  for i in listA:

    if(i.is_number()):

      if(int(i)%2!=0):

        if(i not in resultNumbers):

          resultNumbers.append(int(i))

You may tweak either python script as need!!!

please provide a screen capture of both runs

DO NOT INCLUDE THE DATA WITHIN THE PYTHON SCRIPTS. DATA MUST BE EXTERIOR FILES.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question