我試圖運行wordcount的例子,但我得到了一個jar文件無效的錯誤 [email protected]:/usr/local/hadoop$ bin/hadoop jar hadoop-examples-1.0.3.jar wordcount /user/hduser/Text /user/hduser/Text-output
Not a valid JAR: /usr/local/hado
我需要編寫一個函數來計算文件中的所有單詞並打印單詞的平均長度。 (標點符號務必被刪除。) def average(fileName):
infile = open(fileName,'r')
wordcount = {}
for word in infile.read().split():
if word not in wordcount: