2.安装Spark与Python练习
一、安装Spark
1.检查基础环境hadoop,jdk
2.下载spark
由于上学期已经下载好了Spark,这里没有下载过程的截图
3.配置文件
4.配置环境变量
5.运行
二、Python编程练习:英文文本的词频统计
path='/home/hadoop/wc/f1.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)