2.安装spark和python练习
一、下载spark
1.检查基础环境hadoop,jdk

2.解压,文件夹重命名、权限



3.配置文件


4.环境变量

5.试运行python代码

二、Python编程练习:英文文本的词频统计
1.准备文档,在百度复制一篇英语文章

在wc.py中编写代码
path='/home/hadoop/wc/ff1.txt' with open(path) as f: text=f.read() words = text.split() wc={} for word in words: wc[word]=wc.get(word,0)+1 wclist=list(wc.items()) wclist.sort(key=lambda x:x[1],reverse=True) print(wclist)
结果为


浙公网安备 33010602011771号