一、安装Spark
2.下载spark
3.配置文件
配置环境 vim /usr/local/spark/conf/spark-env.sh
二、Python编程练习:英文文本的词频统计
1.准备文本文件
2.统计每个单词出现的次数
counts = {}
for word in afterwords:
counts[word] = counts.get(word,0) + 1
items = list(counts.items())
items.sort(key=lambda x:x[1],reverse=True)
i=1
while i<=len(items):
word,count = items[i-1]
print("{0:<20}{1}".format(word,count))
i=i+1
3.结果写文件