04 2021 档案
摘要:07 Spark RDD编程 综合实例 英文词频统计 1. 用Pyspark自主实现词频统计过程。 >>> s = txt.lower().split()>>> dd = {}>>> for word in s:... if word not in dd:... dd[word] = 1... el
阅读全文
摘要:二、学生课程分数案例 总共有多少学生?map(), distinct(), count() 开设了多少门课程? 每个学生选修了多少门课?map().countByValue() //map(), countByKey() 每门课程有多少个学生选?map(), countByValue() Tom选修
阅读全文
摘要:05 RDD练习:词频统计,学习课程分数 一、词频统计: 1.读文本文件生成RDD lines 2.将一行一行的文本分割成单词 words flatmap() 3.全部转换为小写 lower() 4.去掉长度小于3的单词 filter() 5.去掉停用词 6.转换成键值对 map() 7.统计词频
阅读全文
浙公网安备 33010602011771号