04 2021 档案

摘要:07 Spark RDD编程 综合实例 英文词频统计 >>> s = txt.lower().split()>>> dd = {}>>> for word in s:... if word not in dd:... dd[word] = 1... else:... dd[word] = dic[w 阅读全文
posted @ 2021-04-23 21:14 123wen 阅读(41) 评论(0) 推荐(0)
摘要:06 RDD编程 学生课程分数案例 总共有多少学生?map(), distinct(), count() 开设了多少门课程? 每个学生选修了多少门课?map(), countByKey() 每门课程有多少个学生选?map(), countByValue() Tom选修了几门课?每门课多少分?filt 阅读全文
posted @ 2021-04-23 21:12 123wen 阅读(41) 评论(0) 推荐(0)
摘要:二、学生课程分数案例 1.总共有多少学生?map(), distinct(), count() 2.开设了多少门课程? 3.每个学生选修了多少门课?map(), countByKey() 4.每门课程有多少个学生选?map(), countByValue() 5.Tom选修了几门课?每门课多少分?f 阅读全文
posted @ 2021-04-16 17:30 123wen 阅读(53) 评论(0) 推荐(0)
摘要:一、词频统计: 1.读文本文件生成RDD lines 2.将一行一行的文本分割成单词 words flatmap() lines=sc.textFile("file:///usr/local/spark/mycode/wordcount/word.txt") words = lines.flatMa 阅读全文
posted @ 2021-04-05 11:21 123wen 阅读(459) 评论(0) 推荐(0)