Hadoop MapReduce
import sys
linecount=0
# Get input lines from stdin
for line in sys.stdin:
# Remove spaces from beginning and end of the line
line = line.strip()
# Remove the 2., and only keep the decimals
if linecount == 0:
line = line[2:]
# Split it into list of numbers
numbers = list(line)
# Output tuples on stdout
for number in numbers:
print ('%s\t%s' % (number, "1"))
linecount+=1Last updated