i am trying to run my first mapreduce program on amazon aws. i tested the code running locally, there is no problem with the code. however, whenever i tried to run on aws, it just results above error. my program code:
# -*- coding: utf-8 -*-
## python mr_statistics.py inputFile.txt > output.txt
from mrjob.job import MRJob
from math import sqrt
class mrMeanStd(MRJob):
def mapper(self, key, line):
num = float(line)
var = [num,num*num]
yield 1,var
def reducer(self, n, vars):
N = 0.0
sumv = 0.0
sumsq = 0.0
for x in vars:
N += 1
sumv += x[0]
sumsq += x[1]
mean = sumv/N
sd = sqrt(sumsq/N - mean*mean)
results = [mean,sd]
yield results
if __name__ == '__main__':
mrMeanStd.run()
Here is my console output error log:
Any help, thank you!!!
Aucun commentaire:
Enregistrer un commentaire