Hi@akhtar,
Any job in Hadoop must have two phases: one is a mapper and another one is a reducer. You can write codes for the mapper in python script to run it under Hadoop. I have attached one script below for your reference.
!/usr/bin/python
import sys
# Input takes from standard input for myline in sys.stdin:
# Remove whitespace either side
myline = myline.strip()
# Break the line into words
words = myline.split()
# Iterate the words list
for myword in words:
# Write the results to standard output
print '%s\t%s' % (myword, 1)